/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* App Header */
.app-header {
    background: linear-gradient(45deg, #2196F3, #21CBF3);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.1);
}

.search-bar {
    padding: 0 20px 15px;
    animation: slideDown 0.3s ease;
}

.search-bar input {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 25px;
    background: rgba(255,255,255,0.9);
    font-size: 1rem;
    outline: none;
}

/* Profile Link in Header */
.profile-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    transition: background 0.3s ease;
}

.profile-link:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Main Content */
.main-content {
    margin-top: 80px;
    margin-bottom: 80px;
    padding: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Progress Card */
.progress-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.progress-card:hover {
    transform: translateY(-2px);
}

.progress-card h3 {
    margin-bottom: 15px;
    color: #2196F3;
    font-size: 1.1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Materi Cards */
.materi-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.materi-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.materi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.materi-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.materi-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.materi-card:hover .materi-thumbnail img {
    transform: scale(1.05);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.play-button:hover {
    background: rgba(0,0,0,0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.materi-info {
    padding: 20px;
}

.materi-info h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #333;
}

.materi-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.materi-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.difficulty {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.difficulty.mudah {
    background: #E8F5E8;
    color: #4CAF50;
}

.difficulty.sedang {
    background: #FFF3E0;
    color: #FF9800;
}

.difficulty.sulit {
    background: #FFEBEE;
    color: #F44336;
}

.status {
    font-size: 0.8rem;
    color: #666;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    padding: 5px;
    transition: all 0.3s ease;
    flex: 1;
}

.nav-item.active {
    color: #2196F3;
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 3px;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 2000;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* Quick Actions in Video Page */
.quick-actions-video {
    padding: 20px;
    background: #f8f9fa;
    margin: 20px 0;
    border-radius: 15px;
}

.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-small {
    padding: 12px 15px;
    font-size: 0.9rem;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-secondary.btn-small {
    background: #6c757d;
    color: white;
}

.btn-secondary.btn-small:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Study Notes Improvements */
.notes-container {
    position: relative;
}

.notes-save-status {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.notes-save-status.saving {
    opacity: 1;
    background: #ffc107;
    color: #000;
}

.notes-save-status.saved {
    opacity: 1;
    background: #28a745;
    color: white;
}

.notes-save-status.error {
    opacity: 1;
    background: #dc3545;
    color: white;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 480px) {
    .main-content {
        padding: 15px;
    }
    
    .materi-thumbnail {
        height: 180px;
    }
    
    .header-content {
        padding: 12px 15px;
    }
    
    .header-content h1 {
        font-size: 1.3rem;
    }
}

/* Utility Classes */
.btn-primary {
    background: linear-gradient(45deg, #2196F3, #21CBF3);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.hidden {
    display: none;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* User Welcome Styles */
.user-welcome h1 {
    font-size: 1.3rem;
    margin: 0;
    font-weight: 600;
}

.user-welcome p {
    font-size: 0.85rem;
    margin: 2px 0 0 0;
    opacity: 0.9;
    font-weight: 400;
}
