/* Theme Colors */
:root {
    --teak: #ba956f;
    --outer-space: #191f1e;
    --nebula: #cbdbd7;
    --dove-gray: #646464;
    --white: #ffffff;
    --success: #4caf50;
    --danger: #f44336;
    --shadow: rgba(25, 31, 30, 0.1);
    --shadow-dark: rgba(25, 31, 30, 0.3);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--nebula) 0%, var(--white) 100%);
    min-height: 100vh;
    color: var(--outer-space);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px var(--shadow);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo {
    height: 60px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
}

.header-text {
    text-align: left;
}

.header h1 {
    font-size: 2.5rem;
    color: var(--outer-space);
    margin-bottom: 0.25rem;
    text-shadow: 2px 2px 4px var(--shadow);
}

.business-name {
    color: var(--teak);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.subtitle {
    color: var(--dove-gray);
    font-size: 1.1rem;
    font-style: italic;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-around;
    background: var(--outer-space);
    color: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px var(--shadow-dark);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--teak);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Controls */
.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--teak);
    color: var(--white);
}

.btn-primary:hover {
    background: #a67f5b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-dark);
}

.btn-secondary {
    background: var(--dove-gray);
    color: var(--white);
}

.btn-secondary:hover {
    background: #555;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-dark);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-dark);
}

/* Search */
.search-container {
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 15px 20px;
    border: 2px solid var(--nebula);
    border-radius: 50px;
    font-size: 1rem;
    background: var(--white);
    color: var(--outer-space);
    display: block;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--teak);
    box-shadow: 0 0 0 3px rgba(186, 149, 111, 0.1);
}

/* Season Filter */
.season-filter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.season-filter label {
    font-weight: 600;
    color: var(--outer-space);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.season-select {
    padding: 12px 16px;
    border: 2px solid var(--nebula);
    border-radius: 8px;
    background: var(--white);
    color: var(--outer-space);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.season-select:focus {
    outline: none;
    border-color: var(--teak);
    box-shadow: 0 0 0 3px rgba(186, 149, 111, 0.1);
}

.season-select:hover {
    border-color: var(--teak);
}

/* Bingo Grid */
.bingo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.bird-card {
    background: var(--white);
    border-radius: 15px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.bird-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-dark);
    border-color: var(--teak);
}

.bird-card.spotted {
    background: var(--success);
    color: var(--white);
}

.bird-card.spotted .bird-emoji {
    transform: scale(1.2);
}

.bird-card.spotted .bird-image {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* Hover effects for bird images */
.bird-card:hover .bird-image {
    transform: scale(1.05);
    filter: brightness(1.05);
}

.bird-card.spotted:hover .bird-image {
    transform: scale(1.15);
}

.bird-card.spotted::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    color: var(--white);
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.bird-emoji {
    font-size: 3rem;
    display: block;
    text-align: center;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

/* Bird image styles */
.bird-image {
    width: min(8vw, 120px);
    height: min(8vw, 120px);
    object-fit: cover;
    display: block;
    margin: 0 auto 0.5rem auto;
    border-radius: 20px;
    transition: transform 0.3s ease, filter 0.3s ease;
    position: relative;
    /* Add a subtle feathered edge effect */
    background: linear-gradient(135deg, var(--nebula) 0%, transparent 100%);
    background-blend-mode: overlay;
}

/* Soft feathered border effect */
.bird-image::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 21px;
    background: linear-gradient(45deg,
        rgba(186, 149, 111, 0.3),
        rgba(203, 219, 215, 0.2),
        rgba(186, 149, 111, 0.3)
    );
    z-index: -1;
    filter: blur(1px);
}

.bird-name {
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 0;
    color: var(--outer-space);
}

.bird-card.spotted .bird-name {
    color: var(--white);
}

.bird-scientific {
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
    color: var(--dove-gray);
    margin-bottom: 1rem;
}

.bird-card.spotted .bird-scientific {
    color: rgba(255, 255, 255, 0.8);
}

.bird-habitat {
    font-size: 0.8rem;
    text-align: center;
    color: var(--dove-gray);
    background: var(--nebula);
    padding: 0.5rem;
    border-radius: 20px;
}

.bird-card.spotted .bird-habitat {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(25, 31, 30, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px var(--shadow-dark);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    color: var(--dove-gray);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--outer-space);
}

#modal-bird-name {
    color: var(--outer-space);
    margin: 1rem 0;
    text-align: center;
}

#modal-bird-description {
    color: var(--dove-gray);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.modal-bird-image {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0;
    border-radius: 15px;
    overflow: hidden;
    min-height: 200px;
}

.modal-bird-image .bird-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.modal-bird-image .bird-emoji {
    font-size: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 200px;
    background: var(--nebula);
    border-radius: 15px;
}

.modal-actions {
    text-align: center;
}

/* Form styles for Add Bird modal */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--outer-space);
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--nebula);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--teak);
    box-shadow: 0 0 0 3px rgba(186, 149, 111, 0.1);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-note {
    font-size: 0.9rem;
    color: var(--dove-gray);
    margin-bottom: 1.5rem;
    text-align: center;
    font-style: italic;
}

/* Custom bird styles */
.custom-bird {
    border: 2px solid var(--success);
    position: relative;
}

.custom-indicator {
    color: var(--success);
    font-weight: bold;
    margin-left: 0.5rem;
}

/* Make custom bird indicator visible when spotted */
.bird-card.spotted .custom-indicator {
    color: var(--teak);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--outer-space);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: none;
    z-index: 100;
    box-shadow: 0 2px 8px var(--shadow-dark);
}

.offline-indicator.show {
    display: block;
    animation: slideInRight 0.5s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .logo-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-text {
        text-align: center;
    }

    .logo {
        height: 50px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .bingo-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .bird-image {
        width: min(12vw, 110px);
        height: min(12vw, 110px);
    }

    .stats-bar {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .controls {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .bingo-grid {
        grid-template-columns: 1fr;
    }

    .bird-card {
        padding: 1rem;
    }

    .bird-image {
        width: min(20vw, 100px);
        height: min(20vw, 100px);
    }

    .modal-content {
        margin: 5% auto;
        padding: 1.5rem;
        max-height: 95vh;
        width: 95%;
    }

    .modal-bird-image .bird-image {
        max-width: 100%;
        max-height: 250px;
    }

    .modal-bird-image .bird-emoji {
        font-size: 3rem;
        height: 150px;
    }
}

/* Print styles for offline reference */
@media print {
    body {
        background: white;
    }

    .controls, .search-container, .offline-indicator {
        display: none;
    }

    .bird-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--dove-gray);
    }
}

/* Animation for new spotted birds */
@keyframes celebration {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1.2) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.bird-card.just-spotted {
    animation: celebration 0.6s ease-in-out;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--dove-gray);
    font-style: italic;
}

/* No results with add bird option */
.no-results {
    text-align: center;
    padding: 2rem;
}

.add-search-bird {
    margin-top: 1rem;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--success);
    color: var(--white);
}

.add-search-bird:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-dark);
}

/* Storage Notice Banner */
.storage-notice-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--outer-space);
    color: var(--white);
    z-index: 1000;
    box-shadow: 0 -2px 10px var(--shadow-dark);
    animation: slideUpBanner 0.3s ease-out;
}

.storage-notice-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.storage-notice-text {
    flex: 1;
}

.storage-notice-text strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--teak);
}

.storage-notice-text p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--nebula);
    line-height: 1.4;
}

#dismiss-storage-notice {
    flex-shrink: 0;
    min-width: 80px;
    font-size: 0.9rem;
    padding: 8px 16px;
}

@keyframes slideUpBanner {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Adjust body padding when banner is shown */
body.storage-notice-visible {
    padding-bottom: 90px;
}

/* Responsive design for banner */
@media (max-width: 768px) {
    .storage-notice-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 20px;
    }

    .storage-notice-text {
        margin-bottom: 15px;
    }

    #dismiss-storage-notice {
        min-width: 100px;
    }

    body.storage-notice-visible {
        padding-bottom: 120px;
    }
}

/* Share Results Styles */
#share-results-btn {
    display: none; /* Hidden by default, shown when birds are spotted */
}

.share-intro {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--dove-gray);
    line-height: 1.5;
}

.share-preview {
    background: var(--nebula);
    padding: 1rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--success);
}

.share-preview p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.share-preview p:first-child {
    font-weight: 600;
    color: var(--outer-space);
}

#spotted-count-preview {
    color: var(--success);
    font-weight: bold;
}

/* Success message styles */
.share-success {
    text-align: center;
    padding: 2rem;
}

.share-success h3 {
    color: var(--success);
    margin-bottom: 1rem;
}

.share-success p {
    color: var(--dove-gray);
    line-height: 1.5;
    text-align: center;
}

.email-content-container {
    margin: 1.5rem 0;
    text-align: left;
}

.email-header {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--nebula);
    border-radius: 8px;
    font-size: 0.9rem;
}

.email-body {
    margin-bottom: 1rem;
}

.copy-textarea {
    width: 100%;
    height: 200px;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border: 2px solid var(--nebula);
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.85rem;
    background: var(--white);
    resize: vertical;
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
}

.copy-textarea:focus {
    outline: none;
    border-color: var(--teak);
    box-shadow: 0 0 0 3px rgba(186, 149, 111, 0.1);
}
