/* Advanced Dark Mode CSS with Modern Effects */
:root {
    /* Light Mode Colors */
    --primary-color: #ff4757;
    --secondary-color: #2f3542;
    --accent-color: #1e90ff;
    --light-color: #f1f2f6;
    --dark-color: #2f3542;
    --success-color: #2ed573;
    --warning-color: #ffa502;
    --danger-color: #ff4757;
    --text-color: #2f3542;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --header-gradient: linear-gradient(135deg, var(--primary-color), var(--accent-color);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --border-color: #e0e0e0;
    
    /* Dark Mode Colors - will be activated via JavaScript */
    --dm-primary-color: #ff6b81;
    --dm-secondary-color: #57606f;
    --dm-accent-color: #70a1ff;
    --dm-light-color: #a4b0be;
    --dm-dark-color: #f1f2f6;
    --dm-text-color: #f1f2f6;
    --dm-bg-color: #1e272e;
    --dm-card-bg: #2f3542;
    --dm-header-gradient: linear-gradient(135deg, var(--dm-primary-color), var(--dm-accent-color);
    --dm-shadow-color: rgba(0, 0, 0, 0.3);
    --dm-border-color: #57606f;
}

/* Dark Mode Class */
.dark-mode {
    --primary-color: var(--dm-primary-color);
    --secondary-color: var(--dm-secondary-color);
    --accent-color: var(--dm-accent-color);
    --light-color: var(--dm-light-color);
    --dark-color: var(--dm-dark-color);
    --text-color: var(--dm-text-color);
    --bg-color: var(--dm-bg-color);
    --card-bg: var(--dm-card-bg);
    --header-gradient: var(--dm-header-gradient);
    --shadow-color: var(--dm-shadow-color);
    --border-color: var(--dm-border-color);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: var(--secondary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 5px 15px var(--shadow-color);
    border: none;
    font-size: 1.2rem;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--accent-color);
}

/* Header Styles */
.viral-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    padding: 30px 0;
    background: var(--header-gradient);
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-color);
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.viral-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background-clip: text;
    -webkit-background-clip: text;
}

.viral-title span {
    display: inline-block;
    transition: all 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.viral-title:hover span {
    transform: translateY(-5px);
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
    letter-spacing: 1px;
}

/* Video Grid Styles */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.video-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    border: 1px solid var(--border-color);
}

.video-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px var(--shadow-color);
    z-index: 10;
}

.video-thumbnail {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.3s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.video-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 40%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card:hover .video-thumbnail::before {
    opacity: 1;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 3rem;
    z-index: 2;
    opacity: 0.8;
    transition: all 0.3s ease;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.video-card:hover .play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

.video-info {
    padding: 15px;
}

.video-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-category {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 5px;
    letter-spacing: 1px;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.pagination-btn:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.pagination-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 5px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.page-number:hover, .page-number.active {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
    border-color: var(--primary-color);
}

/* Admin Button */
.admin-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--secondary-color);
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 5px 15px var(--shadow-color);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    z-index: 100;
    border: none;
}

.admin-float-btn:hover {
    background: var(--accent-color);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px var(--shadow-color);
}

/* Video Modal Styles */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.video-modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 80%;
    max-width: 900px;
    background: transparent;
    animation: modalFadeIn 0.4s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    color: var(--primary-color);
    transform: rotate(90deg) scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

/* Loading Animation */
.loading-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--card-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Admin Panel Styles */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.admin-header h1 {
    font-size: 2rem;
    color: var(--text-color);
}

.admin-header h1 span {
    color: var(--primary-color);
    font-weight: 400;
}

.view-site-btn, .logout-btn {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.view-site-btn {
    background: var(--accent-color);
    color: white;
    border: none;
}

.view-site-btn:hover {
    background: #187bcd;
    transform: translateY(-2px);
}

.logout-btn {
    background: var(--danger-color);
    color: white;
    margin-left: 10px;
    border: none;
}

.logout-btn:hover {
    background: #d63031;
    transform: translateY(-2px);
}

.admin-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

.add-video-form {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.add-video-form h2 {
    margin-bottom: 20px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--card-bg);
    color: var(--text-color);
}

.form-group input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.2);
    outline: none;
}

.submit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.submit-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.form-message {
    margin-top: 20px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.success-message {
    background: rgba(46, 213, 115, 0.2);
    color: var(--success-color);
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.error-message {
    background: rgba(255, 71, 87, 0.2);
    color: var(--danger-color);
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.video-list {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.video-list h2 {
    margin-bottom: 20px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-list-container {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

.admin-video-item {
    display: grid;
    grid-template-columns: 100px 1fr 50px;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.admin-video-item:last-child {
    border-bottom: none;
}

.video-preview img {
    width: 100%;
    border-radius: 5px;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.video-info h3 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--text-color);
}

.video-url {
    font-size: 0.8rem;
    color: var(--light-color);
    word-break: break-all;
}

.video-category {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 600;
}

.delete-btn {
    color: var(--danger-color);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
}

.delete-btn:hover {
    color: #d63031;
    transform: scale(1.2);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .admin-content {
        grid-template-columns: 1fr;
    }
    
    .viral-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .viral-title {
        font-size: 2rem;
    }
    
    .modal-content {
        width: 90%;
    }
    
    .admin-video-item {
        grid-template-columns: 80px 1fr 40px;
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .viral-title {
        font-size: 1.8rem;
        flex-direction: column;
    }
    
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .admin-header-actions {
        display: flex;
        width: 100%;
        justify-content: space-between;
    }
    
    .view-site-btn, .logout-btn {
        width: 48%;
        margin-left: 0;
        justify-content: center;
    }
    
    .theme-toggle {
        bottom: 90px;
        left: 20px;
    }
    
    .admin-float-btn {
        bottom: 20px;
        right: 20px;
    }
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.viral-title span {
    animation: float 3s ease-in-out infinite;
}

.viral-title span:nth-child(1) { animation-delay: 0.1s; }
.viral-title span:nth-child(2) { animation-delay: 0.2s; }
.viral-title span:nth-child(3) { animation-delay: 0.3s; }
.viral-title span:nth-child(4) { animation-delay: 0.4s; }
.viral-title span:nth-child(5) { animation-delay: 0.5s; }
.viral-title span:nth-child(7) { animation-delay: 0.6s; }
.viral-title span:nth-child(8) { animation-delay: 0.7s; }
.viral-title span:nth-child(9) { animation-delay: 0.8s; }
.viral-title span:nth-child(10) { animation-delay: 0.9s; }
.viral-title span:nth-child(12) { animation-delay: 1.0s; }
.viral-title span:nth-child(13) { animation-delay: 1.1s; }
.viral-title span:nth-child(14) { animation-delay: 1.2s; }
.viral-title span:nth-child(15) { animation-delay: 1.3s; }
.viral-title span:nth-child(16) { animation-delay: 1.4s; }
.viral-title span:nth-child(17) { animation-delay: 1.5s; }
.viral-title span:nth-child(18) { animation-delay: 1.6s; }
.viral-title span:nth-child(19) { animation-delay: 1.7s; }

/* Hover Effects */
.hover-grow {
    transition: transform 0.3s ease;
}

.hover-grow:hover {
    transform: scale(1.05);
}

/* Glass Morphism Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}