/* K-Chemistry AP Hub Custom Styles */

/* Smooth transitions for all elements */
* {
    transition: all 0.3s ease;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Navigation animations */
#nav-panel.active #nav-sidebar {
    transform: translateX(0);
}

/* Unit color themes */
.unit-blue { border-left: 4px solid #1e40af; background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); }
.unit-green { border-left: 4px solid #059669; background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); }
.unit-purple { border-left: 4px solid #7c3aed; background: linear-gradient(135deg, #e9d5ff 0%, #ddd6fe 100%); }
.unit-red { border-left: 4px solid #dc2626; background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); }
.unit-orange { border-left: 4px solid #ea580c; background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%); }
.unit-teal { border-left: 4px solid #0d9488; background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%); }
.unit-indigo { border-left: 4px solid #4338ca; background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); }
.unit-pink { border-left: 4px solid #db2777; background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); }
.unit-cyan { border-left: 4px solid #0891b2; background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%); }
.unit-emerald { border-left: 4px solid #059669; background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); }
.unit-violet { border-left: 4px solid #7c2d12; background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%); }

/* Hover effects for cards */
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Resource type colors */
.resource-video { color: #dc2626; background-color: #fef2f2; }
.resource-homework { color: #1e40af; background-color: #eff6ff; }
.resource-worksheet { color: #059669; background-color: #f0fdf4; }
.resource-notes { color: #7c3aed; background-color: #f5f3ff; }
.resource-study_guide { color: #ea580c; background-color: #fff7ed; }
.resource-revision_sheet { color: #0d9488; background-color: #f0fdfa; }
.resource-mock_exam { color: #be123c; background-color: #fff1f2; }
.resource-past_paper { color: #6b21a8; background-color: #faf5ff; }

/* Premium content styling */
.premium-badge {
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1e40af;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Difficulty badges */
.difficulty-beginner {
    background-color: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.difficulty-intermediate {
    background-color: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.difficulty-advanced {
    background-color: #fecaca;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

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

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Search and filter styling */
.search-input {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    width: 100%;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Filter chips */
.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f3f4f6;
    color: #374151;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-chip:hover {
    background: #e5e7eb;
}

.filter-chip.active {
    background: #1e40af;
    color: white;
}

/* Progress indicators */
.progress-ring {
    width: 60px;
    height: 60px;
    transform: rotate(-90deg);
}

.progress-ring-circle {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 4;
    stroke-dasharray: 113;
    stroke-dashoffset: 113;
    transition: stroke-dashoffset 0.5s ease-in-out;
}

.progress-ring-circle.progress {
    stroke: #1e40af;
}

/* Responsive design enhancements */
@media (max-width: 768px) {
    #nav-sidebar {
        width: 100vw;
        max-width: 320px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles would go here */
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Animation for content loading */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom checkbox styling for admin interface */
.custom-checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    position: relative;
}

.custom-checkbox:checked {
    background: #1e40af;
    border-color: #1e40af;
}

.custom-checkbox:checked::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Tooltip styling */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}