/* Premium styling for Whale Event Tracker */
:root {
    --bg-dark: #07162c;
    --bg-darker: #040d1a;
    --bg-card: rgba(13, 35, 64, 0.7);
    --bg-card-hover: rgba(20, 50, 90, 0.85);
    --border-color: rgba(0, 242, 254, 0.15);
    --border-color-active: rgba(0, 242, 254, 0.6);
    
    --primary: #00f2fe;
    --primary-glow: rgba(0, 242, 254, 0.4);
    --secondary: #4facfe;
    --accent: #ff6b8b;
    --text-main: #f0f6fc;
    --text-muted: #8b9eb8;
    --text-highlight: #ffffff;
    --success: #00e676;
    --danger: #ff1744;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 242, 254, 0.15);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-darker);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Background Animations */
.ocean-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, var(--bg-dark) 0%, var(--bg-darker) 100%);
    z-index: -2;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(0, 242, 254, 0.15), rgba(79, 172, 254, 0.05));
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.1) inset;
    animation: floatUp 25s infinite linear;
}

.bubble-1 { width: 80px; height: 80px; left: 10%; bottom: -100px; animation-duration: 22s; }
.bubble-2 { width: 120px; height: 120px; left: 75%; bottom: -150px; animation-duration: 28s; animation-delay: 2s; }
.bubble-3 { width: 60px; height: 60px; left: 45%; bottom: -80px; animation-duration: 18s; animation-delay: 5s; }
.bubble-4 { width: 100px; height: 100px; left: 88%; bottom: -120px; animation-duration: 35s; animation-delay: 1s; }

@keyframes floatUp {
    0% { transform: translateY(0) scale(1) rotate(0deg); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateY(-110vh) scale(1.1) rotate(360deg); opacity: 0; }
}

/* App Container */
.app-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
    animation: wave 4s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    50% { transform: rotate(10deg) translateY(-5px); }
}

header h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.header-actions {
    display: flex;
    gap: 0.8rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    header {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1.2rem;
    }

    .header-logo {
        width: 100%;
        gap: 0.8rem;
    }

    .logo-icon {
        font-size: 2rem;
    }

    header h1 {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 380px) {
    #btn-share {
        flex: 1;
        justify-content: center;
    }
}

/* Buttons */
.btn {
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: none;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease-in-out;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--bg-darker);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.btn-success:hover {
    background: #00ff87;
    box-shadow: 0 4px 12px rgba(0, 230, 118, 0.3);
}

.btn-danger-outline {
    background: rgba(255, 23, 68, 0.1);
    border: 1px solid rgba(255, 23, 68, 0.3);
    color: var(--danger);
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: white;
}

/* Shared Progression Banner */
.banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(79, 172, 254, 0.15);
    border: 1px solid var(--secondary);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.4s ease-out;
}

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

.banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.banner-icon {
    font-size: 1.3rem;
    color: var(--primary);
}

.banner-actions {
    display: flex;
    gap: 0.6rem;
}

.hidden {
    display: none !important;
}

/* Progress Section */
.progress-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .progress-section {
        grid-template-columns: 1fr;
    }
}

.progress-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.8rem;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.progress-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
}

.progress-number {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
}

.progress-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    height: 14px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-fill {
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    height: 100%;
    border-radius: 30px;
    width: 0;
    transition: width 0.5s cubic-bezier(0.1, 0.8, 0.3, 1);
    box-shadow: 0 0 10px var(--primary-glow);
}

.quick-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
}

#stat-collected { color: var(--primary); }
#stat-remaining { color: var(--text-muted); }

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.2rem;
}

/* Controls */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.search-filter-row {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: center;
}

@media (max-width: 768px) {
    .search-filter-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.search-box {
    position: relative;
    flex-grow: 1;
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s;
    backdrop-filter: blur(8px);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.hide-acquired-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
    user-select: none;
    white-space: nowrap;
}

.hide-acquired-btn:hover {
    border-color: var(--border-color-active);
    color: var(--text-main);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

.hide-acquired-btn.active {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: inset 0 0 5px rgba(0, 242, 254, 0.2), 0 0 10px rgba(0, 242, 254, 0.1);
}

.view-toggle-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.3rem;
    display: flex;
    gap: 0.2rem;
    backdrop-filter: blur(8px);
}

.view-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 600;
    padding: 0.7rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.view-btn.active {
    background: rgba(0, 242, 254, 0.1);
    color: var(--primary);
    box-shadow: inset 0 0 5px rgba(0, 242, 254, 0.2);
}

/* Categories Scrollbar */
.categories-container {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.categories-container::-webkit-scrollbar {
    height: 6px;
}

.categories-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 242, 254, 0.2);
    border-radius: 10px;
}

.category-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    white-space: nowrap;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 500;
    transition: all 0.2s;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
}

.category-btn.active {
    background: var(--primary);
    color: var(--bg-darker);
    font-weight: 700;
    border-color: var(--primary);
}

/* Items Grid View */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    animation: fadeIn 0.4s ease-out;
}

/* Item Card */
.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    user-select: none;
    box-shadow: var(--shadow-sm);
}

.item-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-color-active);
    box-shadow: var(--shadow-md), 0 0 10px rgba(0, 242, 254, 0.1);
}

.item-card.collected {
    border-color: var(--success);
    background: rgba(0, 230, 118, 0.04);
}

.item-card.collected:hover {
    box-shadow: var(--shadow-md), 0 0 12px rgba(0, 230, 118, 0.15);
}

.item-card-image-wrapper {
    width: 100%;
    aspect-ratio: 127/106.26;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.item-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.item-card:hover .item-card-image {
    transform: scale(1.1);
}

.item-card-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    z-index: 1;
}

.item-card.collected .item-card-badge {
    border-color: var(--success);
    color: var(--success);
}

/* Checkmark indicator inside card */
.item-card-checkbox {
    margin-top: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s;
}

.item-card.collected .item-card-checkbox {
    color: var(--success);
}

.checkbox-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.checkbox-dot i {
    font-size: 0.65rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46);
}

.item-card.collected .checkbox-dot {
    border-color: var(--success);
    background: var(--success);
}

.item-card.collected .checkbox-dot i {
    color: var(--bg-darker);
    opacity: 1;
    transform: scale(1);
}

/* Poster Container View */
.poster-container {
    width: 100%;
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    box-shadow: var(--shadow-md);
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.poster-wrapper {
    position: relative;
    max-width: 800px;
    width: 100%;
    height: auto;
}

.poster-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.poster-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

/* Overlay clickable grid elements */
.overlay-cell {
    position: absolute;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.15s ease;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-cell:hover {
    background: rgba(0, 242, 254, 0.15);
    border-color: var(--primary);
}

.overlay-cell.collected {
    background: rgba(0, 230, 118, 0.18);
    border-color: var(--success);
}

.overlay-cell.collected:hover {
    background: rgba(0, 230, 118, 0.28);
}

.overlay-cell::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.5vw;
    color: var(--bg-darker);
    background: var(--success);
    border-radius: 50%;
    width: 2.2vw;
    height: 2.2vw;
    max-width: 28px;
    max-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

@media (min-width: 800px) {
    .overlay-cell::after {
        font-size: 12px;
        width: 20px;
        height: 20px;
    }
}

.overlay-cell.collected::after {
    opacity: 1;
    transform: scale(1);
}

.overlay-cell.filtered-out {
    opacity: 0.15;
    pointer-events: none;
}

/* Toast Container & Notification */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 9999;
}

.toast {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border-left: 4px solid var(--primary);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: var(--text-main);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    animation: slideIn 0.3s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

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

.toast.success { border-left-color: var(--success); }
.toast.info { border-left-color: var(--secondary); }

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 13, 26, 0.8);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.25s ease-out;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color-active);
    border-radius: 24px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body p {
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

.share-url-box {
    display: flex;
    gap: 0.8rem;
}

.share-url-box input {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.3);
    color: var(--primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.share-url-box input:focus {
    outline: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.03);
    margin-top: 2rem;
}