* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', 'Poppins', sans-serif;
    background: #f8f9fa;
    color: #1a1a1a;
    overflow-x: hidden;
}

/* Navigation Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    z-index: 1000;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hamburger {
    width: 30px;
    height: 24px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: #2c3e50;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Sidebar Menu */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.08);
    z-index: 999;
    transition: left 0.3s ease;
    padding-top: 80px;
}

.sidebar.active {
    left: 0;
}

.sidebar-item {
    padding: 1rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    color: #2c3e50;
}

.sidebar-item:hover {
    background: rgba(52, 152, 219, 0.08);
    border-left-color: #3498db;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* User Auth Button */
.auth-btn {
    padding: 0.5rem 1.5rem;
    background: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.user-menu {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
}

.user-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 150px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: rgba(52, 152, 219, 0.08);
    color: #3498db;
}

/* Main Content */
.main-content {
    margin-top: 80px;
    padding: 2rem;
    min-height: calc(100vh - 80px - 200px);
}

/* Instructor Grid */
.instructor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.instructor-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    /*cursor: pointer;*/
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    height: 380px;
    display: flex;
    flex-direction: column;
}

.instructor-card:hover {
    transform: translateY(-8px);
    border-color: #3498db;
    box-shadow: 0 12px 32px rgba(52, 152, 219, 0.15);
}

.instructor-thumbnail {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.instructor-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.instructor-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.instructor-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    color: #2c3e50;
}

.instructor-description {
    font-size: 0.9375rem;
    color: #5a6c7d;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.video-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.video-card:hover {
    transform: translateY(-8px);
    border-color: #3498db;
    box-shadow: 0 12px 32px rgba(52, 152, 219, 0.15);
}

.video-thumbnail {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
    position: relative;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #7f8c8d;
}

/* Video Player Page */
.player-page {
    display: none;
}

.player-page.active {
    display: block;
}

.player-container {
    max-width: 1400px;
    margin: 0 auto;
}

.video-player {
    width: 100%;
    max-height: calc(100vh - 180px);
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}

@media (max-aspect-ratio: 16/9) {
    .video-player {
        width: auto;
        max-width: 100%;
        height: calc(100vh - 180px);
    }
}

.video-player video {
    width: 100%;
    height: 100%;
}

.video-details {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.video-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.video-title-large {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
}

.video-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(52, 152, 219, 0.08);
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-radius: 8px;
    color: #3498db;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(52, 152, 219, 0.15);
    border-color: #3498db;
}

.video-stats {
    display: flex;
    gap: 2rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.video-description {
    color: #5a6c7d;
    line-height: 1.6;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(52, 152, 219, 0.08);
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-radius: 8px;
    color: #3498db;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.back-btn:hover {
    background: rgba(52, 152, 219, 0.15);
    border-color: #3498db;
}

.related-videos {
    margin-top: 2rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Comments Section */
.comments-section {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.comment-input-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.comment-input-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.comment-input {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.9375rem;
    resize: vertical;
    transition: all 0.3s ease;
    color: #2c3e50;
}

.comment-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.comment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.comment-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.comment-btn-cancel {
    background: transparent;
    color: #7f8c8d;
}

.comment-btn-cancel:hover {
    background: rgba(0, 0, 0, 0.05);
}

.comment-btn-submit {
    background: #3498db;
    color: #ffffff;
}

.comment-btn-submit:hover {
    background: #2980b9;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.comment-btn-submit:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    box-shadow: none;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.comment-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.comment-author {
    font-weight: 600;
    color: #2c3e50;
}

.comment-date {
    color: #7f8c8d;
    font-size: 0.875rem;
}

.comment-content {
    color: #5a6c7d;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.comment-footer {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.comment-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #7f8c8d;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.comment-action:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.08);
}

.comment-count {
    color: #7f8c8d;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    background: #2c3e50;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem 2rem 2rem;
    color: #ecf0f1;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffffff;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #3498db;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: #3498db;
    color: #ffffff;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #95a5a6;
}

.kuse-branding {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    color: #95a5a6;
}

.kuse-branding:hover {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.kuse-branding svg {
    height: 1.2em;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }

    .instructor-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .main-content {
        padding: 1rem;
    }

    .video-header {
        flex-direction: column;
        gap: 1rem;
    }

    .video-actions {
        width: 100%;
        justify-content: space-between;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}