/* ==================== RESET & VARIABLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #818cf8;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f97316;
    --dark: #1e293b;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --bg: #f1f5f9;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.25);
    --radius: 16px;
    --radius-sm: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--dark);
    min-height: 100vh;
    padding-bottom: 70px;
}

/* ==================== LOGIN PAGE ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}

.login-card {
    background: var(--white);
    border-radius: 28px;
    padding: 2rem 2rem 2.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-wrapper img {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 12px;
    padding: 8px;
    object-fit: contain;
}

.login-header h2 {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 0.3rem;
}

.login-header p {
    color: var(--gray);
    font-size: 0.9rem;
}

.login-header .badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    margin-top: 0.8rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

.form-group label i {
    color: var(--primary);
    margin-right: 6px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.form-control {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-hint {
    font-size: 0.7rem;
    color: var(--gray);
    margin-top: 5px;
    display: block;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.back-to-site {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 50px;
    background: var(--bg);
}

.back-to-site:hover {
    color: var(--primary);
}

.security-note {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-light);
    font-size: 0.75rem;
    color: var(--gray);
}

.security-note i {
    color: var(--success);
    margin-right: 5px;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--success);
}

/* ==================== PARENT DASHBOARD ==================== */
.parent-header {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: white;
    border-radius: 10px;
    padding: 5px;
}

.logo-text h1 {
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.logo-text p {
    font-size: 0.6rem;
    color: var(--gray);
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.student-name {
    font-weight: 600;
    color: var(--primary-dark);
    background: var(--bg);
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #fef2f2;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 8px 12px 12px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
    border-top: 1px solid var(--gray-light);
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--gray);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.2s;
}

.bottom-nav .nav-item i {
    font-size: 1.2rem;
}

.bottom-nav .nav-item.active {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
}

/* Main Content */
.parent-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Loading */
.loading-placeholder {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 45px;
    height: 45px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.3rem;
}

.stat-info {
    text-align: right;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--gray);
}

/* Cards */
.info-card, .upcoming-card, .cycle-card, .payment-card, .laporan-card, .attendance-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.upcoming-card {
    border-left: 4px solid var(--accent);
}

.upcoming-header {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.upcoming-session {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
}

.upcoming-date {
    color: var(--gray);
    font-size: 0.85rem;
    margin: 4px 0;
}

.upcoming-time {
    color: var(--gray);
    font-size: 0.85rem;
}

.upcoming-meet {
    margin-top: 8px;
}

.upcoming-meet a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
}

.info-card h3 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.student-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    font-size: 0.85rem;
}

.info-label {
    font-weight: 600;
    color: var(--gray);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status-verified {
    background: #d1fae5;
    color: #065f46;
}

.status-pending {
    background: #fed7aa;
    color: #92400e;
}

/* Cycle Card */
.cycle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.cycle-title {
    font-weight: 600;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cycle-badge {
    background: var(--primary-light);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
}

.cycle-expand-icon {
    color: var(--primary);
    transition: transform 0.2s;
}

.cycle-card.expanded .cycle-expand-icon {
    transform: rotate(90deg);
}

.cycle-sessions {
    display: none;
    margin-top: 1rem;
    border-top: 1px solid var(--gray-light);
    padding-top: 1rem;
}

.cycle-card.expanded .cycle-sessions {
    display: block;
}

.session-item {
    padding: 0.8rem;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.session-item:last-child {
    border-bottom: none;
}

.session-number {
    font-weight: 600;
    color: var(--dark);
}

.session-datetime {
    font-size: 0.75rem;
    color: var(--gray);
    margin-top: 4px;
}

.session-datetime i {
    margin-right: 4px;
}

.session-topic {
    font-size: 0.75rem;
    color: var(--dark);
    margin-top: 4px;
}

/* Laporan Card */
.laporan-card {
    cursor: pointer;
    transition: all 0.2s;
}

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

.laporan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.laporan-title {
    font-weight: 600;
    color: var(--primary-dark);
}

.laporan-score {
    font-size: 1.2rem;
    font-weight: 700;
}

.score-value {
    color: var(--accent);
    font-size: 1.4rem;
}

.laporan-grades {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 8px;
}

.laporan-preview {
    font-size: 0.8rem;
    color: var(--dark);
    margin-bottom: 8px;
}

.laporan-pdf {
    margin-top: 8px;
}

.laporan-pdf a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.8rem;
}

/* Attendance Card */
.attendance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.attendance-session {
    font-weight: 600;
    color: var(--dark);
}

.attendance-date, .attendance-date-marked {
    font-size: 0.75rem;
    color: var(--gray);
    margin: 6px 0;
}

.attendance-topic {
    font-size: 0.85rem;
    color: var(--dark);
    margin: 8px 0;
    padding: 8px;
    background: var(--bg);
    border-radius: 8px;
}

.attendance-image img {
    width: 100%;
    max-width: 200px;
    border-radius: 12px;
    margin-top: 8px;
    cursor: pointer;
}

/* Payment Card */
.payment-card {
    border-left: 4px solid var(--gray-light);
}

.payment-card.pending {
    border-left-color: var(--warning);
}

.payment-card.verified {
    border-left-color: var(--success);
}

.payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.payment-cycle {
    font-weight: 600;
    color: var(--dark);
}

.payment-amount {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.payment-date {
    font-size: 0.7rem;
    color: var(--gray);
    margin: 6px 0;
}

.payment-link, .payment-links {
    margin: 10px 0;
}

.payment-link a, .payment-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.8rem;
}

.btn-outline-sm {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.7rem;
    margin-right: 8px;
}

.payment-qr {
    text-align: center;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.qr-code-img {
    max-width: 150px;
    margin: 10px auto;
    display: block;
    border-radius: 12px;
}

.bank-details {
    margin-top: 10px;
    font-size: 0.8rem;
}

.bank-details strong {
    color: var(--primary-dark);
}

.payment-note {
    font-size: 0.7rem;
    color: var(--gray);
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Section Subtitle */
.section-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 1.5rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Stats Summary */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.stat-summary-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-summary-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-summary-label {
    font-size: 0.7rem;
    color: var(--gray);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--white);
    border-radius: var(--radius);
    color: var(--gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--white);
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--white);
}

.modal-header h3 {
    font-size: 1rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--gray);
}

.modal-body {
    padding: 1rem;
}

.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-light);
}

.detail-label {
    font-weight: 600;
    width: 110px;
    color: var(--gray);
    font-size: 0.8rem;
}

.detail-value {
    flex: 1;
    font-size: 0.85rem;
    color: var(--dark);
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--gray-light);
    display: flex;
    justify-content: flex-end;
}

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
}

.loading-spinner-large {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 80px;
    left: 20px;
    right: 20px;
    background: var(--dark);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    z-index: 1500;
    display: none;
    text-align: center;
    font-size: 0.85rem;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* Responsive */
@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .stats-summary {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .bottom-nav {
        display: none;
    }
    
    body {
        padding-bottom: 0;
    }
    
    .toast {
        left: auto;
        right: 20px;
        min-width: 300px;
        bottom: 20px;
    }
}
