:root {
    --primary-color: #2c8c99;
    --primary-dark: #1e6169;
    --primary-light: #42b0bf;
    --secondary-color: #88d498;
    --background-color: #f0f7f8;
    --text-color: #2d3436;
    --text-light: #636e72;
    --danger-color: #e17055;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --status-bar-color: #1e6169;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', Arial, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    position: relative;
}

/* Auth Loading Overlay */
.auth-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background-color);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.auth-loading-spinner {
    border: 4px solid #e0e0e0;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.auth-loading-message {
    font-size: 1.1rem;
    color: var(--primary-dark);
    font-weight: 500;
}

/* Hide main content initially until auth is resolved */
body:not(.auth-resolved) header,
body:not(.auth-resolved) main,
body:not(.auth-resolved) .mobile-nav,
body:not(.auth-resolved) .site-footer {
    opacity: 0;
    visibility: hidden;
}

header {
    position: sticky;
    top: 0;
    background-color: var(--white);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
    z-index: 100;
    min-height: 64px;
    flex-wrap: nowrap;
    width: 100%;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-center {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    max-width: 600px;
    margin: 0 20px;
}

.logo {
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    padding: 5px;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.9;
}

.logo img {
    height: 40px;
    width: auto;
    display: block;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-left: 12px;
}

.search-container {
    display: flex;
    width: 100%;
    max-width: 500px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.search-container input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 20px 0 0 20px;
    font-size: 16px;
    transition: border-color 0.2s;
    background: var(--background-color);
    border-right: none;
}

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

.search-container button {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.search-container button i {
    color: white !important;
    font-size: 16px;
}

.search-container button:hover {
    background-color: var(--primary-dark);
}

.action-buttons {
    display: flex;
    gap: 16px;
    align-items: center;
}

.action-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
    box-shadow: 0 2px 8px rgba(44, 140, 153, 0.08);
    outline: none;
    margin-left: 0;
    margin-right: 0;
    position: relative;
}

.action-btn:not(:last-child) {
    margin-right: 8px;
}

.action-btn:hover, .action-btn:focus {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(44, 140, 153, 0.13);
    transform: translateY(-2px) scale(1.03);
}

.action-btn:active {
    transform: scale(0.98);
}

.delete-btn {
    background-color: var(--text-light);
    color: var(--white);
}

.delete-btn:hover, .delete-btn:focus {
    background-color: var(--danger-color);
    color: var(--white);
}

.delete-btn.active {
    background-color: var(--danger-color);
}

/* Auth button distinct style */
.header-auth-btn {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(44, 140, 153, 0.06);
    margin-left: 0;
    margin-right: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.header-auth-btn.show {
    opacity: 1;
}

.header-auth-btn:hover, .header-auth-btn:focus {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(44, 140, 153, 0.13);
}

.header-auth-btn:active {
    transform: scale(0.98);
}

.action-btn:focus, .header-auth-btn:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.modal-btn {
    background: transparent;
    color: var(--primary-color);
    border: none;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: color 0.2s;
}
.modal-btn:hover {
    color: var(--primary-dark);
    background: rgba(44,140,153,0.08);
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
    padding: 32px;
    max-width: 1800px;
    margin: 0 auto;
    background: var(--background-color);
}

.video-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: #000;
}

.thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .thumbnail img {
    transform: scale(1.05);
}

.video-info {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(to bottom, var(--white) 0%, rgba(240, 247, 248, 0.5) 100%);
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.channel-name {
    font-size: 14px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.delete-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(225, 112, 85, 0.2);
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.delete-confirm {
    background-color: var(--danger-color);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.video-card.delete-mode {
    transform: scale(0.98);
}

.video-card.delete-mode:hover {
    transform: scale(0.98);
}

.video-card.delete-mode .delete-overlay {
    display: flex;
}

/* 404 Page Styles */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.error-content {
    background: white;
    padding: 50px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    max-width: 600px;
    width: 100%;
    border: 1px solid #e9ecef;
}

.error-logo {
    margin-bottom: 30px;
}

.error-code {
    font-size: 100px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    line-height: 1;
    letter-spacing: -2px;
}

.error-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-color);
    margin: 25px 0 20px 0;
    line-height: 1.2;
}

.error-message {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 40px;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.error-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.error-btn {
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 16px;
    min-width: 140px;
}

.error-btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(44, 140, 153, 0.3);
}

.error-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(44, 140, 153, 0.4);
}

.error-btn-secondary {
    background: #f8f9fa;
    color: var(--text-color);
    border: 2px solid #e9ecef;
}

.error-btn-secondary:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-1px);
}

.error-illustration {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    font-weight: bold;
    box-shadow: 0 8px 25px rgba(44, 140, 153, 0.25);
}

.error-details {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.error-help {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 15px;
}

.error-suggestions {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    display: inline-block;
}

.error-suggestions li {
    padding: 5px 0;
    font-size: 14px;
    color: #6c757d;
}

.error-suggestions li:before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

@media (max-width: 600px) {
    .error-content {
        padding: 40px 25px;
        margin: 20px;
    }
    
    .error-code {
        font-size: 80px;
    }
    
    .error-title {
        font-size: 26px;
    }
    
    .error-message {
        font-size: 16px;
    }
    
    .error-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .error-btn {
        width: 100%;
    }
    
    .error-illustration {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }
}

.video-card.delete-mode:hover .delete-confirm {
    transform: translateY(0);
    opacity: 1;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.video-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
}

.video-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 8px;
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Keep hover effect for desktop if desired, but start with visible actions */
.video-card:hover .video-actions {
    opacity: 1;
}

/* Ensure video actions are always visible on all devices */
@media (max-width: 900px) {
    .video-actions {
        opacity: 1 !important;
    }
}

.share-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.share-btn i {
    color: white !important;
    font-size: 14px;
}

.share-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.menu-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.menu-btn i {
    color: white !important;
    font-size: 14px;
}

.menu-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.star-btn {
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
}

.star-btn i {
    color: #ffffff !important;
    font-size: 16px;
    transition: all 0.3s ease;
    text-shadow: none;
}

.star-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.star-btn:hover i {
    color: #ffd700 !important;
    transform: rotate(360deg) scale(1.1);
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
}

.star-btn.starred {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 193, 7, 0.2));
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.star-btn.starred {
    color: #ffd700;
}

.star-btn.starred i {
    color: #ffd700 !important;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.star-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    z-index: -1;
}

.star-btn:active::before {
    width: 60px;
    height: 60px;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-width: 160px;
    z-index: 1000;
    display: none;
    padding: 8px 0;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
    color: var(--text-color);
}

.context-menu-item:hover {
    background-color: var(--background-color);
}

.context-menu-item i {
    width: 16px;
    font-size: 14px;
    color: var(--text-light) !important;
}

.context-menu-item:hover i {
    color: var(--text-color) !important;
}

#context-delete:hover {
    background-color: rgba(225, 112, 85, 0.1);
    color: var(--danger-color);
}

#context-delete:hover i {
    color: var(--danger-color) !important;
}

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background-color: var(--text-light);
    border-radius: 50%;
    opacity: 0.5;
}

.no-videos {
    text-align: center;
    padding: 64px 0;
    color: var(--text-light);
    font-size: 18px;
    grid-column: 1 / -1;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin: 32px;
}

/* Watch Page Styles */
.player-container {
    display: none;
    padding: 24px;
    max-width: 1800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.video-player-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 24px;
}

.video-column {
    min-width: 0;
}

.player {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-details {
    padding: 24px;
    background: var(--white);
    border-radius: 8px;
    margin-top: 20px;
}

.video-title-large {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
}

.video-description {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
    white-space: pre-line;
}

/* Related Videos Section */
.related-videos {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    height: 100%;
}

.related-videos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--background-light);
}

.related-videos-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.playback-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.autoplay-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.sort-dropdown {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--white);
    font-size: 14px;
    cursor: pointer;
}

.related-videos-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.related-video-card {
    display: grid;
    grid-template-columns: 168px 1fr;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
    cursor: pointer;
}

.related-video-card:hover {
    background-color: var(--background-color);
}

/* Drag and drop styles for custom order mode */
.related-video-card[draggable="true"] {
    transition: opacity 0.2s, transform 0.2s, border 0.2s;
}

.related-video-card[draggable="true"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.related-video-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.related-video-card.drag-over {
    border-top: 3px solid var(--primary-color);
    transform: translateY(2px);
}

.related-thumbnail {
    width: 168px;
    height: 94px;
    border-radius: 4px;
    overflow: hidden;
}

.related-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-info {
    min-width: 0;
}

.related-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-channel {
    font-size: 12px;
    color: var(--text-light);
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 12000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    overflow: auto;
}

.modal {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    margin: 40px auto;
    width: 100%;
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Search Results Styles */
.search-results {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-card {
    display: grid;
    grid-template-columns: 168px 1fr auto;
    gap: 16px;
    padding: 12px;
    border-radius: 8px;
    background: var(--background-light);
    transition: background-color 0.2s;
}

.search-result-card:hover {
    background: var(--background-color);
}

.result-thumbnail {
    position: relative;
    width: 168px;
    height: 94px;
    border-radius: 4px;
    overflow: hidden;
}

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

.result-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.result-title {
    font-size: 14px;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-channel {
    font-size: 13px;
    color: var(--text-light);
}

.result-stats {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-channel-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}



.result-channel-name {
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: none;
}

.result-channel-name:hover {
    color: var(--primary-color);
}

.video-duration-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: none;
}

.result-thumbnail {
    position: relative;
}

.result-views, .result-date {
    font-size: 0.8rem;
}

.add-result-btn {
    align-self: center;
    padding: 8px 16px;
    border-radius: 4px;
    background: var(--primary-color);
    color: white;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-result-btn:hover {
    background: var(--primary-dark);
}

/* Update video URL input for unified search */
#video-url {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

#video-url:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group label[for="video-url"] {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.2s;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

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

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.video-error {
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 4px;
    display: none;
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-btn {
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.modal-btn:hover {
    transform: translateY(-1px);
}

.cancel-btn {
    background-color: #e0e0e0;
    color: var(--text-color);
}

.cancel-btn:hover {
    background-color: #d0d0d0;
}

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

.add-btn:hover {
    background-color: var(--primary-dark);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .video-player-grid {
        grid-template-columns: 1fr;
    }
    
    .related-videos {
        max-height: none;
    }
    
    .related-videos-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        max-height: none;
    }
    
    .related-video-card {
        grid-template-columns: 1fr;
    }
    
    .related-thumbnail {
        width: 100%;
        height: 0;
        padding-top: 56.25%;
        position: relative;
    }
    
    .related-thumbnail img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 900px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 24px;
        padding: 24px;
    }

    .video-info {
        padding: 12px;
    }

    .video-title {
        font-size: 15px;
    }

    .playback-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .related-videos-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .desktop-only {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }
}

/* Main content should flex-grow but leave space for footer */
main {
    flex: 1 0 auto;
    width: 100%;
    padding-bottom: 0;
}

/* Footer styles */
.site-footer {
    flex-shrink: 0;
    background: var(--white);
    padding: 16px 24px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    bottom: 0;
    width: 100%;
    z-index: 100;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.footer-content {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.footer-logo {
    height: 24px;
    width: auto;
    display: block;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.footer-logo:hover {
    opacity: 1;
}

.keep-awake-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.keep-awake-toggle:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.keep-awake-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.toggle-label {
    font-size: 14px;
    color: var(--text-light);
    user-select: none;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
    padding: 6px 8px;
    border-radius: 4px;
}

.footer-link:hover {
    color: var(--primary-color);
    background-color: rgba(44, 140, 153, 0.05);
}

.footer-separator {
    color: var(--text-light);
    opacity: 0.3;
    font-size: 14px;
    user-select: none;
}

.youtube-attribution {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
}

.youtube-attribution:hover {
    color: #ff0000;
    background-color: rgba(255, 0, 0, 0.05);
}

.youtube-attribution::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FF0000"><path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/></svg>') no-repeat center center;
    background-size: contain;
    transition: transform 0.2s ease;
}

.youtube-attribution:hover::before {
    transform: scale(1.1);
}

/* Media queries for footer */
@media (min-width: 769px) {
    .site-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        z-index: 100;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        background: var(--white);
    }

    .footer-content {
        width: 100%;
    }

    main {
        min-height: calc(100vh - 120px); /* Account for header and footer */
        padding-bottom: 64px; /* Ensure content is not hidden behind sticky footer */
    }
}

/* Video Player Enhancements */
.video-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.watch-on-youtube {
    background-color: #FF0000;
    color: var(--white);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.watch-on-youtube:hover {
    background-color: #CC0000;
}

.channel-info {
    margin-bottom: 16px;
}

.channel-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-link:hover {
    color: var(--primary-dark);
}

/* Adjust main content padding for footer */
main {
    flex: 1;
    padding-bottom: 0; /* Remove the padding-bottom since footer will be sticky */
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .video-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-content {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* Channel thumbnail styles */
.channel-thumbnail {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
    background: var(--bg-secondary) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid var(--border-color) !important;
    flex-shrink: 0;
    display: inline-block;
}

.video-details .channel-thumbnail {
    width: 36px;
    height: 36px;
    background: var(--bg-secondary) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid var(--border-color) !important;
    flex-shrink: 0;
}

.result-channel-thumbnail {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-secondary) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid var(--border-color) !important;
    flex-shrink: 0;
    display: inline-block;
}

.channel-info {
    display: flex;
    align-items: center;
    margin: 8px 0;
}

.channel-name {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.channel-name:hover {
    color: var(--primary-color);
}

/* Video player channel info */
.video-details .channel-info {
    margin: 16px 0;
}

.video-details .channel-name {
    font-size: 16px;
    font-weight: 500;
}

/* Adjust spacing for video cards */
.video-card .video-info {
    padding: 12px;
}

.video-card .channel-info {
    margin: 8px 0;
}

/* Playback Controls */
.playback-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.autoplay-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.autoplay-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Legal Pages Styles (Terms & Privacy Policy) */
.legal-content {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 100px; /* Add padding to prevent footer overlap */
}

.legal-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
}

.legal-content section {
    margin-bottom: 2.5rem;
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.legal-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.legal-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.legal-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.legal-content li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.legal-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-content a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.legal-content .last-updated {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Responsive adjustments for legal pages */
@media (max-width: 900px) {
    .legal-content {
        margin: 20px auto;
        padding: 0 15px;
    }

    .legal-content h1 {
        font-size: 2rem;
    }

    .legal-content h2 {
        font-size: 1.5rem;
    }

    .legal-content section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 16px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    flex-direction: column;
}

.mobile-nav-main {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 6px;
    min-height: 64px;
}

.mobile-nav-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 11px;
}

.mobile-footer-link {
    color: var(--text-light);
    text-decoration: none;
    padding: 4px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.mobile-footer-link:hover {
    opacity: 1;
}

.mobile-footer-dot {
    color: var(--text-light);
    opacity: 0.4;
    font-size: 10px;
}

.youtube-link {
    color: #FF0000;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-light);
    font-size: 12px;
    gap: 4px;
    transition: all 0.2s ease;
    padding: 6px 16px;
    border-radius: 8px;
    min-height: 64px;
}

.mobile-nav-item.active {
    color: var(--primary-color);
    background: rgba(44, 140, 153, 0.1);
}

.mobile-nav-item .mobile-nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

.mobile-nav-item .mobile-nav-icon i {
    color: var(--text-color) !important;
    font-size: 20px;
}

.mobile-nav-item svg.mobile-nav-icon {
    stroke: currentColor;
    transition: all 0.2s ease;
}

.mobile-nav-item:hover {
    color: var(--primary-color);
}

.mobile-nav-item:active {
    transform: scale(0.95);
}

/* Mobile Header Adjustments */
@media (max-width: 900px) {
    header {
        padding: 8px 16px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-wrap: nowrap;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .header-left {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .header-center {
        display: flex;
        align-items: center;
        flex: 1;
        justify-content: center;
        margin: 0 12px;
        max-width: none;
    }

    .header-right {
        display: none;
    }

    .logo {
        flex-shrink: 0;
    }

    .logo-text {
        display: none;
    }

    .logo img {
        height: 32px;
    }

    .search-container {
        display: flex;
        width: 100%;
        max-width: none;
    }

    .search-container input {
        padding: 8px 12px;
        border-radius: 20px 0 0 20px;
        background: var(--background-color);
        border: none;
        font-size: 14px;
        flex: 1;
        min-width: 0;
    }

    .search-container button {
        padding: 8px 16px;
        border-radius: 0 20px 20px 0;
        background: var(--primary-color);
        flex-shrink: 0;
    }
}

/* Ensure desktop layout is correct */
@media (min-width: 901px) {
    header {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        width: 100%;
        padding: 12px 24px;
        justify-content: space-between;
    }
    
    .header-left {
        display: flex !important;
        align-items: center !important;
        flex-shrink: 0;
    }
    
    .header-center {
        display: flex !important;
        align-items: center !important;
        flex: 1;
        justify-content: center;
        max-width: 600px;
        margin: 0 20px;
    }
    
    .header-right {
        display: flex !important;
        align-items: center !important;
        gap: 16px;
        flex-shrink: 0;
    }
    
    .search-container {
        display: flex;
        width: 100%;
        max-width: 500px;
    }
    
    .action-buttons {
        display: flex;
        gap: 16px;
        align-items: center;
    }
    
    .header-auth-btn {
        display: block;
    }

    /* Ensure content doesn't get hidden behind mobile nav */
    main {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    .video-grid {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    #player-page {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* Large display optimizations */
@media (min-width: 1400px) {
    .header-center {
        max-width: 800px;
    }
    
    .search-container {
        max-width: 700px;
    }
}

/* Extra large display optimizations */
@media (min-width: 1800px) {
    .header-center {
        max-width: 1000px;
    }
    
    .search-container {
        max-width: 900px;
    }
}

/* Footer */
.site-footer {
    background: var(--white);
    padding: 16px 24px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    bottom: 0;
    width: 100%;
    z-index: 100;
}

/* Media queries */
@media (max-width: 900px) {
    .mobile-nav {
        display: flex;
    }

    .site-footer {
        display: none;
    }

    main {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }

    /* Ensure content doesn't get hidden behind mobile nav */
    .video-grid,
    .related-videos-list {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }

    /* Adjust player page padding */
    #player-page {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
}

@media (min-width: 901px) {
    .mobile-nav {
        display: none !important; /* Ensure mobile nav is hidden on desktop */
    }

    .site-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        z-index: 100;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        background: var(--white);
    }

    main {
        min-height: calc(100vh - 120px); /* Account for header and footer */
        padding-bottom: 64px; /* Ensure content is not hidden behind sticky footer */
    }
}

/* PWA specific styles */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-nav {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }

    .site-footer {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* Now Playing Bar for Background Audio */
.now-playing-bar {
    display: none;
    position: fixed;
    bottom: calc(60px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    background: var(--primary-color);
    padding: 8px 16px;
    color: var(--white);
    z-index: 999;
    animation: slideUp 0.3s ease;
}

.now-playing-bar.visible {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.now-playing-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.now-playing-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.now-playing-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.now-playing-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.now-playing-button {
    background: none;
    border: none;
    color: var(--white);
    padding: 8px;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.now-playing-button:hover {
    opacity: 1;
}

/* Collapsible description */
.video-description-container {
    position: relative;
    margin-top: 16px;
    padding: 0 16px;
}

.video-description {
    max-height: 80px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.video-description.expanded {
    max-height: none;
}

.description-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    padding: 8px 0;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.description-toggle:hover {
    text-decoration: underline;
}

/* Mobile-specific styles */
@media (max-width: 900px) {
    .related-videos-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
    }

    .playback-controls {
        width: 100%;
        justify-content: space-between;
    }

    /* Keep sort-dropdown visible on mobile, but we'll hide specific options via JS */
    .sort-dropdown {
        display: inline-flex;
    }

    /* Hide autoplay toggle on mobile */
    #autoplay-checkbox,
    .autoplay-toggle {
        display: none !important;
    }

    .video-description-container {
        padding: 0 12px;
        margin-top: 12px;
    }

    .video-description {
        max-height: 60px;
        font-size: 13px;
    }

    .video-description.expanded {
        max-height: none;
    }

    .description-toggle {
        width: 100%;
        padding: 8px 12px;
        background: var(--background-light);
        border-radius: 4px;
        margin-top: 8px;
        justify-content: center;
    }

    .video-details {
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .video-header {
        padding: 12px;
    }

    .channel-info {
        padding: 0 12px;
    }
}

/* Orientation handling */
@media screen and (max-width: 768px) {
  /* Force portrait on mobile */
  @media screen and (orientation: landscape) {
    .app-container {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      background: #000;
    }

    .rotation-message {
      display: flex;
      color: white;
      text-align: center;
      padding: 20px;
    }
  }

  /* Hide rotation message in portrait */
  @media screen and (orientation: portrait) {
    .rotation-message {
      display: none;
    }
  }
}

/* Allow any orientation on desktop */
@media screen and (min-width: 769px) {
  .rotation-message {
    display: none;
  }

  .app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
}

/* 1. Mobile nav/footer always at bottom, no duplicate Home */
@media (max-width: 900px) {
  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.97);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.10);
    display: flex;
    flex-direction: column;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
  main {
    padding-bottom: 90px !important;
  }
}

/* 2. Status bar color for PWA/app mode */
@media (display-mode: standalone) {
  body {
    background-color: var(--background-color);
  }
  meta[name="theme-color"] {
    color-scheme: dark;
    background: var(--status-bar-color);
  }
}

/* 3. Mobile header/footer for legal pages */
@media (max-width: 900px) {
  .legal-mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    z-index: 1200;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  }
  .legal-mobile-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    padding: 12px 0;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    font-size: 15px;
    z-index: 100;
    position: static;
  }
  .legal-content {
    padding-top: 60px;
    padding-bottom: 60px;
  }
}

/* 4. Add Video Modal: confirmation with thumbnail */
.add-video-confirm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
}
.add-video-confirm img {
  width: 160px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.add-video-confirm .confirm-text {
  font-size: 17px;
  color: var(--text-color);
  font-weight: 500;
  text-align: center;
}
.add-video-confirm .confirm-actions {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}
.add-video-confirm .modal-btn {
  min-width: 80px;
}

@media (max-width: 900px) {
  .now-playing-bar {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .footer-link, .footer-content {
    display: none !important;
  }
}

/* Auth Page Styles */
.auth-container {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0f7fa 0%, #f0f7f8 100%);
    padding: 32px 8px;
}

.auth-card {
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(44, 140, 153, 0.10), 0 1.5px 6px rgba(44, 140, 153, 0.07);
    padding: 36px 32px 28px 32px;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.auth-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}

.auth-tab {
    flex: 1;
    padding: 12px 0;
    border: none;
    background: #f0f7f8;
    color: var(--primary-color);
    font-size: 17px;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    outline: none;
}
.auth-tab.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(44, 140, 153, 0.10);
}
.auth-tab:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 15px;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 2px;
}
.form-group input {
    padding: 12px 16px;
    border-radius: 999px;
    border: 1.5px solid #e0e0e0;
    font-size: 16px;
    background: #f8fafb;
    transition: border-color 0.18s, box-shadow 0.18s;
    outline: none;
}
.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(44, 140, 153, 0.10);
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.18s;
}
.auth-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.auth-error {
    color: #e17055;
    background: #fff3f1;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 15px;
    margin-bottom: 0;
    display: none;
    align-items: center;
    gap: 8px;
}
.auth-error.visible {
    display: flex;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 18px 0 10px 0;
    color: var(--text-light);
    font-size: 14px;
    gap: 12px;
}
.auth-divider span {
    background: #f0f7f8;
    padding: 0 12px;
    border-radius: 999px;
}
.auth-divider:before, .auth-divider:after {
    content: '';
    flex: 1;
    height: 1.5px;
    background: #e0e0e0;
    border-radius: 1px;
}

.modal-btn.add-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-weight: 700;
    font-size: 16px;
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(44, 140, 153, 0.10);
    transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
    width: 100%;
}
.modal-btn.add-btn:hover, .modal-btn.add-btn:focus {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(44, 140, 153, 0.13);
    transform: translateY(-2px) scale(1.03);
}

.modal-btn {
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 0;
    border: none;
    margin-top: 0;
    margin-bottom: 0;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.12s;
}

.modal-btn.cancel-btn {
    background: transparent;
    color: var(--primary-color);
    font-weight: 600; /* Keep consistent with modal-btn */
    box-shadow: none; /* Remove any inherited shadow */
}

.modal-btn.cancel-btn:hover {
    color: var(--primary-dark); /* Darken text on hover */
    text-decoration: underline; /* Add underline on hover */
}



/* Responsive adjustments for auth page */
@media (max-width: 768px) {
    .auth-container {
        padding: 16px;
        min-height: 100vh;
        justify-content: flex-start;
    }
    
    .auth-card {
        padding: 24px 20px;
        max-width: 100%;
        margin: 0;
        border-radius: 16px; /* Slightly smaller border-radius */
        box-shadow: 0 4px 16px rgba(44, 140, 153, 0.1); /* Lighter shadow */
    }
    
    .logo {
        margin-bottom: 20px !important;
        margin-top: 16px !important;
        justify-content: center;
    }
    
    .auth-tabs {
        margin-bottom: 20px; /* Slightly less margin */
        gap: 8px;
    }
    
    .auth-tab {
        font-size: 16px;
        padding: 12px 0;
        font-weight: 600;
    }
    
    .form-group {
        gap: 8px;
    }
    
    .form-group label {
        font-size: 14px;
        font-weight: 600;
    }
    
    .form-group input {
        font-size: 16px;
        padding: 14px 16px;
        border-radius: 10px; /* Slightly smaller border-radius */
    }
    
    .modal-btn, .modal-btn.add-btn {
        font-size: 16px;
        padding: 14px 0;
        border-radius: 10px; /* Slightly smaller border-radius */
    }
    
    .auth-divider {
        font-size: 13px;
        margin: 18px 0 10px 0; /* Adjusted margin */
    }
    
    .auth-link {
        font-size: 15px;
    }
    
    .transfer-videos-container {
        padding: 12px; /* Slightly less padding */
        border-radius: 10px; /* Slightly smaller border-radius */
    }
    
    .transfer-videos-label {
        font-size: 14px;
    }
    
    .transfer-videos-info { /* Updated to new class */
        font-size: 12px;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 12px 8px;
        background: linear-gradient(135deg, #e0f7fa 0%, #f0f7f8 50%, #e8f5e8 100%);
    }
    
    .auth-card {
        padding: 20px 16px;
        border-radius: 12px; /* Even smaller border-radius */
        box-shadow: 0 2px 10px rgba(44, 140, 153, 0.1); /* Lighter shadow */
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
    }
    
    .logo {
        margin-bottom: 16px !important;
        margin-top: 12px !important;
    }
    
    .logo img {
        height: 32px;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
    
    .auth-tabs {
        margin-bottom: 16px; /* Slightly less margin */
        gap: 6px;
    }
    
    .auth-tab {
        font-size: 15px;
        padding: 10px 0;
        border-radius: 10px; /* Slightly smaller border-radius */
    }
    
    .form-group {
        gap: 6px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input {
        font-size: 16px;
        padding: 12px 14px;
        border-radius: 8px; /* Even smaller border-radius */
    }
    
    .modal-btn, .modal-btn.add-btn {
        font-size: 15px;
        padding: 12px 0;
        border-radius: 8px; /* Even smaller border-radius */
    }
    
    .auth-divider {
        font-size: 12px;
        margin: 14px 0 8px 0; /* Adjusted margin */
    }
    
    .auth-link {
        font-size: 14px;
    }
    
    .transfer-videos-container {
        padding: 10px; /* Slightly less padding */
        border-radius: 8px; /* Even smaller border-radius */
        margin: 6px 0;
    }
    
    .transfer-videos-container::before {
        font-size: 16px;
        top: 10px;
        right: 12px;
    }
    
    .transfer-videos-label {
        font-size: 13px;
        gap: 10px;
    }
    
    .transfer-videos-checkbox {
        width: 18px;
        height: 18px;
    }
    
    .transfer-videos-info { /* Updated to new class */
        font-size: 11px;
        margin-top: 6px;
    }
}

@media (max-width: 360px) {
    .auth-container {
        padding: 8px 4px;
    }
    
    .auth-card {
        padding: 16px 12px;
        border-radius: 12px;
    }
    
    .logo img {
        height: 28px;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .auth-tabs {
        gap: 4px;
    }
    
    .auth-tab {
        font-size: 14px;
        padding: 9px 0;
    }
    
    .form-group input {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    .modal-btn, .modal-btn.add-btn {
        font-size: 14px;
        padding: 10px 0;
    }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Remove old welcome message styles */
.welcome-message {
    display: none;
}

/* Add new welcome message banner styles */
.welcome-message-banner {
    width: 100%;
    background: linear-gradient(to right, var(--primary-light), var(--primary-color));
    color: var(--white);
    text-align: center;
    padding: 12px 24px;
    font-size: 1.1em;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(44, 140, 153, 0.15);
}

.welcome-message-banner:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 900px) {
    .welcome-message-banner {
        font-size: 0.95em;
        padding: 10px 16px;
    }
}

/* Success message styling */
.success-message {
    background-color: #4CAF50;
    color: white;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Global Loading Overlay */
.global-loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.75);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  transition: opacity 0.2s;
}
.global-loading-spinner {
  border: 6px solid #e0e0e0;
  border-top: 6px solid var(--primary-color);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  animation: spin 1s linear infinite;
  margin-bottom: 18px;
}
.global-loading-message {
  font-size: 1.2rem;
  color: var(--primary-dark);
  margin-bottom: 6px;
}
.global-loading-progress {
  font-size: 1rem;
  color: #555;
}

/* Global Error Toast */
.global-error-toast {
  position: fixed;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger-color);
  color: #fff;
  padding: 16px 32px;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  font-size: 1.1rem;
  z-index: 10000;
  opacity: 0.98;
  animation: fadeIn 0.3s;
  min-width: 220px;
  text-align: center;
  pointer-events: all;
}

@media (max-width: 600px) {
  /* Make add-video modal act as full-screen sheet on mobile */
  .modal-overlay {
    align-items: stretch; /* full height */
    padding: 0;
  }
  .modal {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
  }
}

.footer-social a svg {
  color: #1e6169;
  transition: color 0.2s;
  vertical-align: middle;
}
.footer-social a:hover svg {
  color: #0077b5;
}
.footer-logo {
  margin-right: 28px;
}

.legal-mobile-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  font-size: 12px;
  line-height: 1;
  position: static; /* Not sticky by default */
}
.mobile-footer-link {
  color: #1e6169;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  font-size: 12px;
}
.mobile-footer-link.youtube-link {
  color: #d32f2f;
  font-weight: 600;
}
.mobile-footer-dot {
  color: #bbb;
  font-size: 14px;
  user-select: none;
}

/* User Avatar */
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--white);
    border: 1.5px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    user-select: none;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.user-avatar:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: scale(1.08);
    box-shadow: 0 3px 12px rgba(44, 140, 153, 0.25);
}

.mobile-user-avatar {
    width: 40px;
    height: 40px;
    font-size: 15px;
    border-width: 1.5px;
    letter-spacing: 0.3px;
}

/* User info container alignment */
#user-info {
    display: flex !important;
    align-items: center !important;
    height: 100%;
    margin-left: 18px !important;
}

#mobile-user-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    text-align: center;
    font-size: 12px;
    color: var(--primary-color);
    margin: 0;
    padding: 6px 16px;
    border-radius: 8px;
    min-height: 60px;
    align-self: center;
}

/* Font Awesome icon styling */
.fas, .far, .fab {
    display: inline-block !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    color: inherit !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure Font Awesome icons are visible and properly styled */
i.fas, i.far, i.fab {
    color: inherit !important;
    opacity: 1 !important;
    visibility: visible !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

/* Specific icon styling for buttons */
.share-btn i.fas {
    color: white !important;
    font-size: 14px !important;
}

.search-container button i.fas {
    color: white !important;
    font-size: 16px !important;
}

.mobile-nav-item i.fas {
    color: var(--text-color) !important;
    font-size: 20px !important;
} 

/* ===== Playlist Drawer ===== */
.playlist-drawer{position:fixed;right:0;top:0;width:320px;height:100%;background:#fff;box-shadow:-2px 0 8px rgba(0,0,0,.1);transform:translateX(100%);transition:transform .3s ease;z-index:1200;display:flex;flex-direction:column;}
.playlist-drawer.open{transform:translateX(0);}
.playlist-item{padding:12px 20px;border-bottom:1px solid #eee;cursor:pointer;}
.playlist-item:hover{background:#f5f5f5;}

/* ===== Transfer Videos Box (No Checkbox) ===== */
.transfer-videos-container {
    background: var(--background-color);
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px; /* Space between box and description */
}

.transfer-videos-container:hover {
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.transfer-videos-container.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(44, 140, 153, 0.15);
}

.transfer-videos-container.selected .transfer-videos-text {
    color: var(--white);
}

.transfer-videos-text {
    font-size: 0.8rem; /* Smaller font size */
    font-weight: 500;
    color: var(--text-color);
    text-align: center;
}

.transfer-videos-info {
    display: block; /* Make it a block element to center text */
    font-size: 0.7rem; /* Subtle font size */
    color: #b0b0b0; /* Very light grey for subtlety */
    text-align: center; /* Center the text */
    margin-top: 4px; /* Smaller space from the box above */
    margin-bottom: 16px; /* Larger space to the button below */
}



@media (max-width: 480px) {
    .transfer-videos-container {
        padding: 8px 10px;
    }
    .transfer-videos-text {
        font-size: 0.85rem;
    }
    .transfer-videos-info {
        font-size: 0.65rem; /* Even smaller on mobile */
    }
}
 