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

:root {
    --primary: var(--primary-color, #667eea);
    --secondary: var(--secondary-color, #764ba2);
    --success: #48bb78;
    --danger: #f56565;
    --warning: #ed8936;
    --info: #4299e1;
    --light: #f7fafc;
    --dark: #2d3748;
    --shadow: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.15);
    --radius: 15px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    padding: 15px 0;
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-brand h2 {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 24px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 14px;
}

.nav-menu a:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    transform: translateY(-2px);
}

.user-menu {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 20px;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.5s ease;
}

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

.auth-box h1 {
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-size: 32px;
}

.auth-box h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
    font-weight: 400;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #718096;
    font-size: 13px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-logout {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
}

.btn-back {
    display: inline-block;
    margin-bottom: 15px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

/* Page Header */
.page-header {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    animation: slideUp 0.5s ease;
}

.page-header h1 {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-size: 28px;
}

.header-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: slideUp 0.5s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 48px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.stat-info h3 {
    font-size: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

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

.dashboard-section {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: slideUp 0.5s ease;
}

.dashboard-section h2 {
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Surat Grid */
.surat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.surat-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: slideUp 0.5s ease;
}

.surat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.surat-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.surat-number {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.surat-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-lancar { 
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}
.status-sedang { 
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}
.status-lemah { 
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
}
.status-belum { 
    background: #e2e8f0;
    color: #4a5568;
}

.surat-card h3 {
    color: var(--dark);
    margin-bottom: 5px;
    font-size: 20px;
}

.surat-arabic {
    font-size: 22px;
    text-align: right;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.surat-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 13px;
    color: #718096;
}

/* Progress Bar */
.progress-bar {
    background: #e2e8f0;
    height: 10px;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    height: 100%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* Ayat Container */
.hafalan-controls {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    box-shadow: var(--shadow);
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.control-group input,
.control-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

.ayat-container {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.ayat-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    transition: var(--transition);
}

.ayat-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.ayat-card.hidden-text .ayat-arabic,
.ayat-card.hidden-text .ayat-latin {
    filter: blur(8px);
    user-select: none;
}

.ayat-number {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.ayat-content {
    flex: 1;
}

.ayat-arabic {
    font-size: 26px;
    text-align: right;
    margin-bottom: 10px;
    line-height: 2;
    color: var(--dark);
    font-weight: 500;
}

.ayat-latin {
    font-style: italic;
    color: #718096;
    margin-bottom: 8px;
}

.ayat-terjemahan {
    color: #4a5568;
    font-size: 14px;
}

.ayat-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-icon {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition);
}

.btn-icon:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: var(--primary);
    transform: scale(1.1);
}

/* List Items */
.list-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    background: var(--light);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.list-item:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

/* Badges */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.badge-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 25px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.badge-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.badge-icon {
    font-size: 56px;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.badge {
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-pending { background: #feebc8; color: #c05621; }
.badge-diterima { background: #c6f6d5; color: #22543d; }
.badge-perbaikan { background: #fed7d7; color: #742a2a; }

/* Table */
.table {
    width: 100%;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
}

.table thead {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:nth-child(even) {
    background: var(--light);
}

.table tbody tr:hover {
    background: #edf2f7;
    transform: scale(1.01);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border-color: #f56565;
}

.alert-info {
    background: #bee3f8;
    color: #2c5282;
    border-color: #4299e1;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-color: #48bb78;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

/* Info Box */
.info-box {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    margin-top: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.info-box h3 {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.info-box ul {
    margin-left: 20px;
    line-height: 1.8;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    margin-top: 50px;
    text-align: center;
    color: #718096;
    box-shadow: var(--shadow);
}

.text-center {
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: center;
    }
    
    .nav-menu a {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .auth-box {
        padding: 30px 20px;
    }
    
    .page-header {
        padding: 20px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .surat-grid {
        grid-template-columns: 1fr;
    }
    
    .hafalan-controls {
        grid-template-columns: 1fr;
    }
    
    .ayat-card {
        flex-direction: column;
    }
    
    .ayat-controls {
        flex-direction: row;
        justify-content: center;
    }
    
    .table {
        font-size: 13px;
    }
    
    .table th,
    .table td {
        padding: 10px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .nav-brand h2 {
        font-size: 20px;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .ayat-arabic {
        font-size: 22px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
