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

:root {
    --font-size: 16px;
    --background: #F8FAFC;
    --foreground: #1E293B;
    --card: #ffffff;
    --card-foreground: #1E293B;
    --primary: #3A7AFE;
    --primary-foreground: #ffffff;
    --secondary: #CBD5E1;
    --secondary-foreground: #1E293B;
    --muted: #F1F5F9;
    --muted-foreground: #64748B;
    --accent: #4ADE80;
    --accent-foreground: #ffffff;
    --border: #CBD5E1;
    --radius: 0.75rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    font-size: var(--font-size);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Header Styles */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--border);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

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

.nav a {
    color: var(--foreground);
    text-decoration: none;
    transition: color 0.3s;
}

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

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 0.875rem;
}

.btn-outline {
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--muted);
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-foreground);
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Search Bar Section */
.search-section {
    width: 100%;
    background: linear-gradient(to bottom, #dbeafe, white);
    padding: 5rem 0;
    text-align: center;
}

.search-container {
    max-width: 56rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.search-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.search-subtitle {
    font-size: 1.25rem;
    color: var(--muted-foreground);
    margin-bottom: 2rem;
}

.search-input-wrapper {
    position: relative;
    max-width: 42rem;
    margin: 0 auto;
}

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

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1.125rem;
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    outline: none;
    transition: box-shadow 0.3s;
}

.search-input:focus {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Main Content Layout */
.main-container {
    max-width: 1280px;
    margin: 0 auto;
}

.content-wrapper {
    display: flex;
    min-height: 600px;
}

/* Sidebar Styles */
.sidebar {
    width: 320px;
    background: white;
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: none;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.menu-item {
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
}

.menu-button {
    width: 100%;
    padding: 1rem;
    background: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.menu-button:hover {
    background: var(--muted);
}

.menu-button-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menu-title {
    font-weight: 600;
    font-size: 1rem;
}

.chevron {
    transition: transform 0.3s;
}

.chevron.expanded {
    transform: rotate(90deg);
}

.submenu {
    display: none;
    border-top: 1px solid var(--border);
    background: rgba(241, 245, 249, 0.2);
}

.submenu.active {
    display: block;
}

.collection-button {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    border-left: 4px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.collection-button:hover {
    background: var(--muted);
    border-left-color: rgba(58, 122, 254, 0.3);
}

.collection-button.active {
    background: rgba(58, 122, 254, 0.1);
    border-left-color: var(--primary);
}

.collection-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.collection-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.4);
}

.collection-button.active .collection-dot {
    background: var(--primary);
}

.collection-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.collection-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.collection-button.active .collection-name {
    color: var(--primary);
}

.collection-meta {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.book-list {
    display: none;
    background: rgba(241, 245, 249, 0.4);
}

.book-list.active {
    display: block;
}

.book-button {
    width: 100%;
    padding: 0.75rem 3rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(203, 213, 225, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.book-button:hover {
    background: var(--muted);
}

.book-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.book-title {
    font-weight: 500;
    font-size: 0.875rem;
}

.book-count {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.word-list {
    display: none;
    background: rgba(241, 245, 249, 0.6);
    padding: 0.75rem 4rem;
    max-height: 12rem;
    overflow-y: auto;
}

.word-list.active {
    display: block;
}

.word-button {
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.word-button:hover {
    background: rgba(74, 222, 128, 0.2);
}

.word-button.selected {
    background: var(--primary);
    color: var(--primary-foreground);
}

.word-badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.word-button.selected .word-badge {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--primary-foreground);
}

/* Mobile Sidebar Button */
.mobile-sidebar-toggle {
    display: block;
    margin: 0.75rem 1rem;
    padding: 1rem;
    background: white;
    border: 2px dashed rgba(58, 122, 254, 0.3);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    width: calc(100% - 2rem);
}

.mobile-sidebar-toggle:hover {
    border-color: rgba(58, 122, 254, 0.5);
    background: rgba(241, 245, 249, 0.5);
}

.mobile-toggle-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-toggle-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.mobile-toggle-title {
    font-weight: 500;
    color: var(--foreground);
}

.mobile-toggle-subtitle {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Video Grid */
.video-section {
    flex: 1;
    padding: 1.5rem;
}

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

.video-title-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.video-subtitle {
    color: var(--muted-foreground);
}

.page-info {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    min-height: 600px;
    margin-bottom: 4rem;
}

/* Video Card */
.video-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.video-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-0.25rem);
}

.video-thumbnail {
    position: relative;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 12rem;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-card:hover .video-overlay {
    opacity: 1;
}

.play-button {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 0.75rem;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.video-card:hover .play-button {
    transform: scale(1);
}

.play-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--primary);
}

.duration-badge {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.word-badge-card {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--accent);
    color: var(--accent-foreground);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.video-content {
    padding: 1rem;
}

.video-title {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s;
}

.video-card:hover .video-title {
    color: var(--primary);
}

.video-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Pagination */
.pagination-section {
    margin: 4rem 0 2rem;
}

.pagination-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
}

.divider-dot {
    margin: 0 1rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: rgba(58, 122, 254, 0.4);
}

.pagination-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

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

.page-button {
    min-width: 44px;
    height: 44px;
    padding: 0.5rem 1rem;
    border: 2px solid rgba(203, 213, 225, 0.5);
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.page-button:hover:not(:disabled) {
    border-color: var(--primary);
    background: rgba(58, 122, 254, 0.05);
    transform: scale(1.05);
}

.page-button:active:not(:disabled) {
    transform: scale(0.95);
}

.page-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: transparent;
}

.page-button.active {
    background: linear-gradient(135deg, var(--primary), rgba(58, 122, 254, 0.8));
    color: var(--primary-foreground);
    border-color: var(--primary);
    box-shadow: 0 10px 15px -3px rgba(58, 122, 254, 0.2);
    transform: scale(1.1);
    font-weight: 600;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(to right, rgba(241, 245, 249, 0.5), rgba(241, 245, 249, 0.3), rgba(241, 245, 249, 0.5));
    border-radius: 9999px;
    border: 1px solid rgba(203, 213, 225, 0.5);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
}

.pulse-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.info-divider {
    width: 1px;
    height: 1rem;
    background: var(--border);
}

.info-text {
    color: var(--muted-foreground);
}

.info-highlight {
    font-weight: 500;
    color: var(--foreground);
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid var(--border);
    margin-top: 5rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.footer-brand {
    grid-column: span 1;
}

.footer-brand h3 {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 1rem;
}

.footer-description {
    color: var(--muted-foreground);
    max-width: 28rem;
}

.footer-section h4 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--muted-foreground);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Icons */
.icon {
    width: 1.25rem;
    height: 1.25rem;
}

.icon-sm {
    width: 0.75rem;
    height: 0.75rem;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--muted-foreground);
}

.modal-content {
    flex: 1;
    overflow-y: auto;
}

.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70%;
    padding: 1.5rem;
}

/* Responsive Design */
@media (min-width: 768px) {
    .nav {
        display: flex;
    }

    .search-title {
        font-size: 3rem;
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .footer-brand {
        grid-column: span 2;
    }
}

@media (min-width: 1024px) {
    .sidebar {
        display: block;
    }

    .mobile-sidebar-toggle {
        display: none;
    }

    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .video-section {
        margin-left: 0;
    }
}