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

:root {
    /* Blue accent color palette */
    --blue-primary: #63b3ed;
    --blue-secondary: #667eea;
    --blue-dark: #3182ce;
    --blue-darker: #2c5282;
    
    /* Blue with opacity variants */
    --blue-primary-alpha-20: rgba(99, 179, 237, 0.2);
    --blue-primary-alpha-10: rgba(99, 179, 237, 0.1);
    --blue-primary-alpha-30: rgba(99, 179, 237, 0.3);
    --blue-primary-alpha-60: rgba(99, 179, 237, 0.6);
    --blue-secondary-alpha-30: rgba(102, 126, 234, 0.3);
    --blue-secondary-alpha-40: rgba(102, 126, 234, 0.4);
    --blue-dark-alpha-30: rgba(49, 130, 206, 0.3);
}

html {
    background: #1a202c;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #e2e8f0;
    background: #1a202c;
    min-height: 100vh;
}

/* Global subtle scrollbar styling for dark theme */
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: rgba(45, 55, 72, 0.3);
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(99, 179, 237, 0.3);
    border-radius: 4px;
    transition: background 0.3s ease;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 179, 237, 0.5);
}

*::-webkit-scrollbar-corner {
    background: rgba(45, 55, 72, 0.3);
}

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

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(26, 32, 44, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: bold;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-link:hover {
    opacity: 0.8;
}

/* Main content */
.main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
    padding-top: 5rem; /* Add space for fixed header */
}

/* Watch time section */
.watch-time-section {
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.watch-time-card {
    background: rgba(42, 48, 62, 0.9);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--blue-primary-alpha-30);
    position: relative;
}

.watch-time-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.watch-time-display {
    margin: 2rem 0;
}

.time-value {
    font-size: 2.5rem;
    font-weight: bold;
    display: block;
    transition: all 0.3s ease;
    position: relative;
}

/* Animation classes for time updates */
.time-value.animating {
    animation: timeUpdate calc(0.8s + 0.8s * var(--animation-intensity, 0.5)) ease-out;
}

.time-value.increase {
    color: #48bb78;
    animation: timeIncrease calc(0.8s + 0.8s * var(--animation-intensity, 0.5)) ease-out;
}

.time-value.decrease {
    color: #f56565;
    animation: timeDecrease calc(0.8s + 0.8s * var(--animation-intensity, 0.5)) ease-out;
}

@keyframes timeUpdate {
    0% { 
        transform: scale(1); 
    }
    25% { 
        transform: scale(calc(1 + 0.05 + 0.1 * var(--animation-intensity, 0.5))); 
    }
    50% { 
        transform: scale(calc(1 + 0.08 + 0.15 * var(--animation-intensity, 0.5))); 
        text-shadow: 0 0 calc(15px + 10px * var(--animation-intensity, 0.5)) var(--blue-primary-alpha-60);
    }
    100% { 
        transform: scale(1); 
        text-shadow: none;
    }
}

@keyframes timeIncrease {
    0% { 
        transform: scale(1); 
        color: inherit;
    }
    15% { 
        transform: scale(calc(1 + 0.1 + 0.2 * var(--animation-intensity, 0.5))); 
        color: #48bb78;
        text-shadow: 0 0 calc(20px + 15px * var(--animation-intensity, 0.5)) rgba(72, 187, 120, 0.7);
    }
    30% { 
        transform: scale(calc(1 + 0.05 + 0.15 * var(--animation-intensity, 0.5))); 
    }
    45% { 
        transform: scale(calc(1 + 0.08 + 0.17 * var(--animation-intensity, 0.5))); 
    }
    60% { 
        transform: scale(calc(1 + 0.02 + 0.08 * var(--animation-intensity, 0.5))); 
    }
    100% { 
        transform: scale(1); 
        color: inherit;
        text-shadow: none;
    }
}

@keyframes timeDecrease {
    0% { 
        transform: scale(1); 
        color: inherit;
    }
    15% { 
        transform: scale(calc(1 - 0.05 - 0.1 * var(--animation-intensity, 0.5))); 
        color: #f56565;
        text-shadow: 0 0 calc(20px + 15px * var(--animation-intensity, 0.5)) rgba(245, 101, 101, 0.7);
    }
    30% { 
        transform: scale(calc(1 - 0.02 - 0.08 * var(--animation-intensity, 0.5))); 
    }
    45% { 
        transform: scale(calc(1 - 0.04 - 0.08 * var(--animation-intensity, 0.5))); 
    }
    60% { 
        transform: scale(calc(1 - 0.01 - 0.03 * var(--animation-intensity, 0.5))); 
    }
    100% { 
        transform: scale(1); 
        color: inherit;
        text-shadow: none;
    }
}

.watch-time-subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Search section */
/* Search section */
.search-section {
    margin-bottom: 1rem;
}

.search-container h3 {
    margin-bottom: 1rem;
    color: #e2e8f0;
}

.search-form {
    position: relative;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-container {
    position: relative;
}

.search-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid rgba(74, 85, 104, 0.8);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(45, 55, 72, 0.9);
    backdrop-filter: blur(10px);
    color: #e2e8f0;
}

.search-button {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--blue-secondary) 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--blue-secondary-alpha-30);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.search-button:hover {
    box-shadow: 0 8px 25px var(--blue-secondary-alpha-40);
    background: linear-gradient(135deg, #764ba2 0%, var(--blue-secondary) 100%);
}

.search-button:active {
    transform: translateY(0);
}

.search-input::placeholder {
    color: #a0aec0;
}

.search-input:focus {
    outline: none;
    border-color: var(--blue-primary);
    background: rgba(45, 55, 72, 0.95);
    box-shadow: 0 4px 16px var(--blue-primary-alpha-20);
}

.search-btn {
    padding: 1rem 2rem;
    background: rgba(103, 126, 234, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(103, 126, 234, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-btn:hover {
    box-shadow: 0 8px 24px rgba(103, 126, 234, 0.4);
    background: rgba(103, 126, 234, 1);
}

/* Search results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(45, 55, 72, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 350px; /* Sized to fit 2 results and load more button */
    overflow-y: auto;
    margin-top: 8px;
    min-height: 50px; /* Ensure minimum height for visibility */
    width: 100%; /* Ensure full width */
}

/* Subtle scrollbar styling for dark theme */
.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: rgba(45, 55, 72, 0.3);
    border-radius: 6px;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(99, 179, 237, 0.4);
    border-radius: 6px;
    transition: background 0.3s ease;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 179, 237, 0.6);
}

.search-loading {
    text-align: center;
    padding: 2rem;
    color: #a0aec0;
    font-size: 1rem;
}

.search-loading i {
    margin-right: 0.5rem;
    color: var(--blue-secondary);
}

.search-no-results {
    text-align: center;
    padding: 2rem;
    color: #a0aec0;
}

.search-no-results i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--blue-secondary);
}

.search-no-results p {
    margin: 0;
    font-size: 1rem;
}

.search-result {
    background: rgba(74, 85, 104, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 0.75rem; /* Reduced from 1rem to make more compact */
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-result:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.search-result:first-child {
    border-radius: 12px 12px 8px 8px;
}

.search-result:hover {
    background: var(--blue-primary-alpha-20);
}

.search-result-content {
    display: flex;
    gap: 0.75rem;
}

.search-result-poster {
    width: 40px;
    height: 60px;
    background: #4a5568;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.search-result-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-info h4 {
    color: #e2e8f0;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.search-result-date {
    color: #a0aec0;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

/* Instant search features */
.search-results-header {
    color: var(--blue-primary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: 500;
    padding: 0.5rem;
    background: var(--blue-primary-alpha-10);
    border-radius: 12px 12px 0 0;
}

.search-result-hint {
    color: var(--blue-primary);
    font-size: 0.7rem;
    margin-top: 0.5rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Search load more button */
.search-load-more {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(74, 85, 104, 0.1);
    border-radius: 0 0 12px 12px;
}

.load-more-btn {
    background: var(--blue-primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.load-more-btn:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 179, 237, 0.3);
}

.load-more-btn:active {
    transform: translateY(0);
}

/* Season selector bars for search results */
.search-result-seasons {
    margin-top: 0.75rem;
}

.season-selector-label {
    color: #a0aec0;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.season-selector-bars {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 0.25rem;
    position: relative;
    z-index: 10;
    border-radius: 4px;
    max-width: 100%;
}

.season-bar {
    background: var(--blue-primary-alpha-30);
    border: 1px solid rgba(99, 179, 237, 0.5);
    color: var(--blue-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 24px;
    text-align: center;
}

.season-bar:hover,
.season-bar.highlighted {
    background: var(--blue-primary-alpha-60);
    color: white;
    box-shadow: 0 2px 8px var(--blue-primary-alpha-30);
}

/* Watched shows section */
.watched-section {
    margin-bottom: 3rem;
}

.watched-container h3 {
    margin-bottom: 1rem;
    color: #e2e8f0;
}

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

.watched-header h3 {
    margin-bottom: 0;
    color: #e2e8f0;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-controls label {
    color: #a0aec0;
    font-size: 0.9rem;
    font-weight: 500;
}

.sort-select {
    padding: 0.5rem;
    border: 1px solid #4a5568;
    border-radius: 6px;
    background: rgba(45, 55, 72, 0.9);
    color: #e2e8f0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-select:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px var(--blue-primary-alpha-10);
}

.sort-select:hover {
    border-color: var(--blue-primary);
}

.watched-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
    gap: 1.5rem;
}

.watched-show {
    background: rgba(42, 48, 62, 0.9);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 1px solid var(--blue-primary-alpha-30);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.watched-show:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.watched-show-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent;
    color: rgba(226, 232, 240, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    z-index: 10;
    border: none;
}

.watched-show-poster {
    width: 120px;
    height: 100%;
    background: #4a5568;
    border-radius: 12px 0 0 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.watched-show-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.watched-show-remove:hover {
    background: rgba(160, 174, 192, 0.2);
    color: rgba(226, 232, 240, 0.9);
}

.watched-show-content {
    flex: 1;
    padding: 1.25rem 1rem 1.25rem 1rem;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.watched-show-info {
    flex: 1;
    min-width: 0; /* Allow shrinking */
    margin-bottom: 1rem;
}

.watched-show-info h4 {
    color: #e2e8f0;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.watched-show-seasons {
    color: #a0aec0;
    font-size: 0.9rem;
}

.watched-show-time {
    color: var(--blue-primary);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    align-self: flex-start;
}

/* Inline season editing */
.seasons-display {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
    display: inline-block;
}

.seasons-display:hover {
    background: var(--blue-primary-alpha-10);
}

.seasons-edit {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
}

.edit-season-bars {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    border-radius: 4px;
    overflow: hidden;
}

.edit-season-bar {
    background: var(--blue-primary-alpha-20);
    border: none;
    border-right: 1px solid rgba(99, 179, 237, 0.4);
    color: var(--blue-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 24px;
    text-align: center;
}

.edit-season-bar:last-child {
    border-right: none;
}

.edit-season-bar:hover,
.edit-season-bar.highlighted,
.edit-season-bar.hover-highlighted {
    background: var(--blue-primary-alpha-60);
    color: white;
    box-shadow: 0 2px 8px var(--blue-primary-alpha-30);
}



.seasons-edit input {
    width: 60px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #4a5568;
    border-radius: 4px;
    font-size: 0.8rem;
    background: rgba(45, 55, 72, 0.9);
    color: #e2e8f0;
}

.seasons-total {
    color: #a0aec0;
    font-size: 0.8rem;
    font-weight: 500;
}

.seasons-edit input:focus {
    outline: none;
    border-color: var(--blue-primary);
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-secondary {
    background: #4a5568;
    color: #e2e8f0;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn:hover {
}

/* Share button */
.share-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: var(--blue-dark);
    border: 1px solid var(--blue-dark);
    border-radius: 8px;
    color: white;
    padding: 0.5rem 1rem;
    height: auto;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.share-btn:hover {
    background: var(--blue-darker);
    border-color: var(--blue-darker);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--blue-dark-alpha-30);
}

.share-btn:active {
    transform: translateY(0);
}

.share-btn i {
    font-size: 0.9rem;
}

.share-btn span {
    margin: 0;
}

/* Data management section */
.remove-all-section {
    margin-top: 2rem;
    padding: 1rem 0;
}

.remove-all-container {
    text-align: center;
}

.data-management-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.export-btn, .import-btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: var(--blue-dark);
    border: 1px solid var(--blue-dark);
}

.export-btn:hover, .import-btn:hover {
    background: var(--blue-darker) !important;
    border-color: var(--blue-darker);
    transform: translateY(-1px);
}

.refresh-seasons-btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: #38a169;
    border: 1px solid #38a169;
    color: white;
}

.refresh-seasons-btn:hover {
    background: #2f855a !important;
    border-color: #2f855a;
    transform: translateY(-1px);
    color: white;
}

.remove-all-btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.remove-all-btn:hover {
    background: #c53030 !important;
    transform: translateY(-1px);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #a0aec0;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #4a5568;
}

.empty-state h4 {
    margin-bottom: 1rem;
    color: #cbd5e0;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #2d3748;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    color: #e2e8f0;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #4a5568;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #a0aec0;
}

.modal-close:hover {
    color: #e2e8f0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #4a5568;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.show-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.show-poster {
    width: 80px;
    height: 120px;
    background: #4a5568;
    border-radius: 8px;
    overflow: hidden;
}

.show-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.show-details h5 {
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

.show-details p {
    color: #cbd5e0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #4a5568;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: rgba(45, 55, 72, 0.9);
    color: #e2e8f0;
}

.form-input:focus {
    outline: none;
    border-color: var(--blue-primary);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    color: #a0aec0;
    font-size: 0.8rem;
}

/* Loading spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 32, 44, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    color: #e2e8f0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #4a5568;
    border-top: 4px solid var(--blue-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 80px; /* Position below fixed header */
    right: 20px;
    z-index: 3000;
}

.toast {
    background: #2d3748;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border-left: 4px solid var(--blue-primary);
    animation: slideIn 0.3s ease-out;
}

.toast.error {
    border-left-color: #e53e3e;
}

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

/* Statistics page */
.stats-overview {
    margin-bottom: 3rem;
}

.stats-overview h2 {
    margin-bottom: 1rem;
    margin-top: 1rem;
    color: #e2e8f0;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: rgba(42, 48, 62, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--blue-primary-alpha-30);
}

.stat-card:hover {
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--blue-primary);
}

.stat-content h3 {
    font-size: 2rem;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

.stat-content p {
    color: #cbd5e0;
    font-weight: 500;
}

.completion-stats,
.genre-stats,
.yearly-stats {
    margin-bottom: 3rem;
}

.completion-stats h3,
.genre-stats h3,
.yearly-stats h3 {
    margin-bottom: 1.5rem;
    color: #4a5568;
}

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

.completion-card {
    background: rgba(42, 48, 62, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--blue-primary-alpha-30);
}

.completion-info h4 {
    font-size: 1.5rem;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

.completion-info p {
    color: #cbd5e0;
}

.genre-list,
.yearly-list {
    display: grid;
    gap: 1rem;
}

.genre-item,
.yearly-item {
    background: rgba(45, 55, 72, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.genre-name,
.year-name {
    font-weight: 500;
    color: #e2e8f0;
}

.genre-time,
.year-time {
    color: var(--blue-secondary);
    font-weight: 600;
}

.loading-stats {
    text-align: center;
    padding: 3rem;
}

.stats-empty {
    text-align: center;
    padding: 3rem;
    color: #cbd5e0;
}

.stats-empty h3 {
    margin-bottom: 1rem;
    color: #e2e8f0;
}

/* Utility classes */
.hidden {
    display: none;
}

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

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }

/* Footer */
.footer {
    background: #1a202c;
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer-content p {
    margin-bottom: 0.5rem;
}

.footer a {
    color: #90cdf4;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive design - 3-phase header behavior */

/* Phase 2: Limited width - Hide title text, keep icon only to stay one-row */
@media (max-width: 380px) {
    .logo-text {
        display: none;
    }
}

/* Phase 3: Super limited space - Allow wrap to second row only when absolutely necessary */
@media (max-width: 300px) {
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .logo a {
        font-size: 1.5rem;
    }
    
    .nav {
        gap: 1.5rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
}

/* Legacy mobile breakpoint - keep existing styles for other mobile optimizations */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    /* Mobile card optimizations - reduce height by 35% while maintaining centering */
    .watch-time-card {
        padding: 0.975rem; /* 35% reduction from 1.5rem */
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: auto;
    }
    
    /* Ensure the time display is properly centered in available space */
    .watch-time-display {
        margin: auto; /* Center the display vertically in the remaining space */
        flex: 1; /* Take up available space */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Fix 2: Remove "Time well spent" text on mobile */
    .watch-time-subtitle {
        display: none;
    }
    
    /* Fix 2: Share button margin reduction and positioning */
    .share-btn {
        padding: 0.4rem 0.8rem; /* Reduced padding */
        right: 0.75rem; /* Reduced right margin */
        bottom: 0.75rem; /* Reduced bottom margin */
        font-size: 0.85rem; /* Slightly smaller font */
    }
    
    /* Fix 3: Reduce show card height by 35% on mobile */
    .watched-show-content {
        min-height: 117px; /* 35% reduction from 180px */
        padding: 1rem 0.75rem; /* Reduced padding */
    }
    
    /* Fix 4: Halve the distance between show cards */
    .watched-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem; /* Halved from 1.5rem */
    }
    
    /* Fix 5: Remove internal scrolling in search results on mobile */
    .search-results {
        max-height: none;
        overflow-y: visible;
        position: relative; /* Change from absolute to relative */
        margin-top: 8px;
        margin-bottom: 1rem;
    }
    
    /* Fix 5: Make bottom buttons same size and better alignment */
    .data-management-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        justify-content: center;
        align-items: center;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .export-btn, .import-btn, .refresh-seasons-btn, .remove-all-btn {
        font-size: 0.8rem;
        padding: 0.6rem 0.4rem;
        text-align: center;
        white-space: nowrap;
        min-height: 44px; /* Consistent button height */
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem; /* Add spacing between icon and text on mobile */
    }
    
    .search-form {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .search-button {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .search-results {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Make time text BIGGER on mobile since there's more space available */
    .time-value {
        font-size: 3rem; /* Increased from desktop size of 2.5rem */
    }
    
    .modal-content {
        width: 95%;
    }
    
    /* CRITICAL FIX: Reduce poster width by ~35% on mobile */
    .watched-show-poster {
        width: 78px; /* 35% reduction from 120px */
    }
}

/* Charts Section Styles */
.charts-section {
    margin-bottom: 3rem;
}

.charts-section h3 {
    margin-bottom: 2rem;
    color: #4a5568;
    text-align: center;
    font-size: 1.8rem;
}

.chart-container {
    margin-bottom: 1.5rem;
    margin-left: 40px;
    margin-right: 40px;
}

.chart-container.horizontal-charts {
    display: flex;
    gap: 2rem;
    align-items: stretch;
}

.chart-half {
    flex: 1;
}

.chart-half h4 {
    color: #4a5568;
    margin-bottom: 1.5rem;
    text-align: left;
    font-size: 1.2rem;
}

.chart-container h4 {
    color: #4a5568;
    margin-bottom: 1.5rem;
    text-align: left;
    font-size: 1.2rem;
}

.plotly-chart {
    min-height: 200px;
    width: 100%;
    border-radius: 10px;
    background: transparent;
}

/* Awards Grid */
.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.award-card {
    background: rgba(42, 48, 62, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--blue-primary-alpha-30);
}

.award-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--blue-primary);
}

.award-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--blue-primary);
    margin: 0 0 0.5rem 0;
}

.award-value {
    font-size: 1rem;
    color: #e2e8f0;
    margin: 0;
    line-height: 1.4;
}

/* Time Conversions Grid */
.time-conversions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.conversion-card {
    background: rgba(42, 48, 62, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--blue-primary-alpha-30);
}


.conversion-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--blue-primary);
}

.conversion-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #e2e8f0;
}

.times-text {
    color: #e2e8f0;
}

.conversion-description {
    color: #cbd5e0;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.conversion-activity {
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* Dark theme for Plotly charts */
.js-plotly-plot .plotly .modebar {
    background: rgba(45, 55, 72, 0.9) !important;
}

.js-plotly-plot .plotly .modebar-btn {
    color: #e2e8f0 !important;
}

/* Responsive adjustments for charts */
@media (max-width: 768px) {
    .chart-container {
        margin-bottom: 1.5rem;
    }
    
    .chart-container.horizontal-charts {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .plotly-chart {
        min-height: 300px;
    }
    
    .time-conversions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .conversion-card {
        padding: 1rem;
    }
    
    .conversion-icon {
        font-size: 2rem;
    }
    
    .conversion-value {
        font-size: 1.4rem;
    }
}
