/* Tutorials Page - Modern PC Design */
* {
    box-sizing: border-box;
}

body {
    background: var(--c-bg);
    min-height: 100vh;
    font-family: var(--font-body);
}

.tutorials-container {
    max-width: 95vw;
    width: 95vw;
    margin: 20px auto;
    padding: 0 20px;
}

.tutorials-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-title {
    background: var(--g-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-subtitle {
    color: #64748b;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 500;
}

.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.tutorials-toolbar {
    margin: 10px 0 30px 0;
}

.toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 260px;
    max-width: 520px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.search-box i {
    color: #667eea;
}

.search-box input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1rem;
    background: transparent;
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter {
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 600;
    background: #fff;
    color: #2c3e50;
    cursor: pointer;
}

.filter-input {
    cursor: text;
    font-weight: 700;
}

.teacher-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.manage-btn,
.create-btn {
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.manage-btn {
    background: #0f172a;
}

.manage-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
}

.create-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.create-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.25);
}

.guest-banner {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 2px solid #f4a261;
    background: linear-gradient(135deg, #fef7f0, #fff5eb);
}

.guest-banner-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #92400e;
}

.guest-banner-btn {
    background: linear-gradient(135deg, #f4a261, #e76f51);
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.guest-banner-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(244, 162, 97, 0.35);
}

.loading-state,
.error-state,
.empty-state {
    text-align: center;
    padding: 35px 10px;
    color: #64748b;
}

.loading-state i,
.error-state i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #667eea;
}

.error-state i {
    color: #ef4444;
}

.empty-state .empty-icon i {
    font-size: 2.2rem;
    color: #667eea;
}

.tutorial-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.tutorial-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #334155;
}

.badge-video {
    background: linear-gradient(135deg, #e8f4fd, #f0f8ff);
    color: #0066cc;
}

.badge-written {
    background: linear-gradient(135deg, #e8f5e8, #f0fff0);
    color: #28a745;
}

.teacher-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #334155;
    text-decoration: none;
}

.teacher-chip img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(102, 126, 234, 0.35);
}

.open-tutorial-btn {
    width: 100%;
    margin-top: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
}

.open-tutorial-btn:hover {
    filter: brightness(1.05);
}

.tutorial-card {
    background: linear-gradient(145deg, #ffffff, #f8f9ff);
    border-radius: 20px;
    padding: 0;
    border: 2px solid #e1e8ed;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
}

.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.tutorial-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.tutorial-icon {
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 12px;
    min-width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.tutorial-content {
    padding: 25px;
}

.tutorial-content p {
    color: #64748b;
    margin: 0 0 20px 0;
    font-size: 1rem;
    line-height: 1.6;
}

.video-placeholder {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.video-placeholder video {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: linear-gradient(135deg, #f0f2f5, #e1e8ed);
    border: none;
    transition: transform 0.3s ease;
}

.video-placeholder:hover video {
    transform: scale(1.02);
}

.tutorial-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-top: 1px solid #e1e8ed;
    margin-top: 15px;
}

.tutorial-stats span {
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.duration {
    background: linear-gradient(135deg, #e8f5e8, #f0fff0) !important;
    color: #28a745 !important;
}

.views {
    background: linear-gradient(135deg, #e8f4fd, #f0f8ff) !important;
    color: #0066cc !important;
}

.help-section {
    margin-top: 50px;
}

.help-card {
    background: linear-gradient(135deg, #fef7f0, #fff5eb);
    border: 2px solid #f4a261;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
}

.help-card h3 {
    color: #d97706;
    margin: 0 0 15px 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.help-card p {
    color: #92400e;
    margin: 0 0 25px 0;
    font-size: 1.1rem;
}

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

.help-btn {
    background: linear-gradient(135deg, #f4a261, #e76f51);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(244, 162, 97, 0.3);
}

.help-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(244, 162, 97, 0.4);
    background: linear-gradient(135deg, #e76f51, #f4a261);
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .tutorials-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 1200px) {
    .tutorials-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .tutorials-container {
        padding: 0 15px;
    }

    .tutorials-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 2rem;
    }

    .toolbar-row {
        align-items: stretch;
    }

    .filters,
    .teacher-actions {
        width: 100%;
    }

    .filter {
        flex: 1;
        min-width: 160px;
    }
}

/* Loading states */
.video-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transform: translateX(-100%);
    animation: loading 1.5s infinite;
    z-index: 1;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}
