/* ============================================================
   SDO Attendance System — Main Stylesheet
   Color Palette: Green (#10B981, #059669), Blue (#3B82F6, #2563EB), White
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --green-50: #ecfdf5;
    --green-100: #d1fae5;
    --green-200: #a7f3d0;
    --green-300: #6ee7b7;
    --green-400: #34d399;
    --green-500: #10b981;
    --green-600: #059669;
    --green-700: #047857;
    --green-800: #065f46;
    
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --blue-300: #93c5fd;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-800: #1e40af;
    
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --warning: #f59e0b;
    --purple: #8b5cf6;
    --teal: #14b8a6;
    
    --gradient-primary: linear-gradient(135deg, var(--green-500), var(--blue-500));
    --gradient-hero: linear-gradient(135deg, var(--green-600) 0%, var(--blue-600) 50%, var(--green-500) 100%);
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    --gradient-glass: linear-gradient(145deg, rgba(255,255,255,0.85), rgba(255,255,255,0.65));
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.06), 0 4px 10px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.08), 0 8px 20px rgba(0,0,0,0.04);
    --shadow-glow-green: 0 0 30px rgba(16, 185, 129, 0.3);
    --shadow-glow-blue: 0 0 30px rgba(59, 130, 246, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-spring: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(160deg, #eef7f0 0%, #e8f4fd 40%, #f0fdf4 70%, #eff6ff 100%);
    color: var(--gray-800);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ---------- Background Shapes ---------- */
.bg-shapes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.25;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: var(--green-300);
    top: -100px;
    right: -100px;
    animation: float1 20s ease-in-out infinite;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: var(--blue-300);
    bottom: -50px;
    left: -80px;
    animation: float2 25s ease-in-out infinite;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: var(--green-200);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float3 18s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-40px, 60px) scale(1.1); }
    66% { transform: translate(30px, -30px) scale(0.95); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -40px) scale(1.05); }
    66% { transform: translate(-30px, 30px) scale(0.9); }
}

@keyframes float3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
}

/* ---------- Glass Card ---------- */
.glass-card {
    background: var(--gradient-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.glass-card:hover {
    box-shadow: var(--shadow-xl);
}

/* ---------- Navbar ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-text h1 {
    font-size: 18px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.brand-text span {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--green-600);
    background: var(--green-50);
}

.nav-link.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow-green);
}

/* ---------- Main Content ---------- */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

/* ---------- Clock Section ---------- */
.clock-section {
    margin-bottom: 32px;
}

.clock-card {
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.clock-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.clock-display {
    margin-bottom: 16px;
}

.time {
    font-size: 64px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -2px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.date {
    font-size: 16px;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 4px;
}

.clock-divider {
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
    margin: 16px auto;
    opacity: 0.5;
}

.greeting {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-700);
}

/* ---------- Steps Indicator ---------- */
.steps-section {
    margin-bottom: 32px;
}

.steps-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 20px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-400);
    font-size: 16px;
    border: 3px solid var(--gray-200);
    transition: var(--transition);
}

.step.active .step-circle {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--green-400);
    box-shadow: var(--shadow-glow-green);
    animation: pulse-ring 2s ease infinite;
}

.step.done .step-circle {
    background: var(--green-500);
    color: white;
    border-color: var(--green-400);
}

.step span {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step.active span,
.step.done span {
    color: var(--green-600);
}

.step-line {
    width: 50px;
    height: 3px;
    background: var(--gray-200);
    border-radius: 2px;
    margin: 0 4px;
    margin-bottom: 28px;
    transition: var(--transition);
}

.step-line.done {
    background: var(--green-500);
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ---------- Card Headers ---------- */
.card-header {
    text-align: center;
    margin-bottom: 28px;
}

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 24px;
    box-shadow: var(--shadow-glow-green);
}

.card-icon.pulse {
    animation: pulse-ring 2s ease infinite;
}

.card-icon.success {
    background: linear-gradient(135deg, var(--green-400), var(--green-600));
}

.card-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.card-header p {
    font-size: 14px;
    color: var(--gray-500);
}

/* ---------- Form Section ---------- */
.form-section {
    margin-bottom: 32px;
}

.form-card {
    padding: 40px;
}

.attendance-form,
.report-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group label i {
    color: var(--green-500);
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    color: var(--gray-800);
    background: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
    outline: none;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--green-400);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    background: white;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow-green);
    transform: translateY(-1px);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255,255,255,0.2) 50%,
        transparent 70%
    );
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(0deg); }
    100% { transform: translateX(100%) rotate(0deg); }
}

.btn-action {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    color: white;
    box-shadow: var(--shadow-md);
    flex: 1;
}

.btn-action:hover {
    box-shadow: var(--shadow-glow-blue);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-hover));
    color: white;
    box-shadow: var(--shadow-md);
    flex: 1;
}

.btn-danger:hover {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--gray-600);
    border: 2px solid var(--gray-200);
}

.btn-outline:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
    color: var(--gray-700);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ---------- Attendance Section ---------- */
.attendance-section {
    margin-bottom: 32px;
}

.attendance-card {
    padding: 36px;
}

.time-slots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
}

.time-slot {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid var(--gray-100);
    transition: var(--transition);
}

.time-slot.recorded {
    border-color: var(--green-200);
    background: var(--green-50);
}

.time-slot.current {
    border-color: var(--blue-300);
    background: var(--blue-50);
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--blue-300); }
    50% { border-color: var(--blue-500); }
}

.slot-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 16px;
    flex-shrink: 0;
}

.time-slot.recorded .slot-icon {
    background: var(--green-500);
    color: white;
}

.time-slot.current .slot-icon {
    background: var(--blue-500);
    color: white;
}

.slot-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.slot-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slot-time {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    font-variant-numeric: tabular-nums;
}

.slot-status {
    color: var(--gray-300);
    font-size: 14px;
}

.time-slot.recorded .slot-status {
    color: var(--green-500);
}

.time-slot.recorded .slot-status i::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.undo-section {
    text-align: center;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-end-session {
    border-color: var(--gray-200);
    color: var(--gray-500);
}

.btn-end-session:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

/* ---------- Report Section ---------- */
.report-section {
    margin-bottom: 32px;
}

.report-card {
    padding: 40px;
}

.completion-summary {
    background: var(--green-50);
    border: 1px solid var(--green-200);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    font-size: 14px;
}

.completion-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--green-100);
}

.completion-summary .summary-row:last-child {
    border-bottom: none;
}

.completion-summary .summary-label {
    color: var(--gray-500);
    font-weight: 500;
}

.completion-summary .summary-value {
    color: var(--green-700);
    font-weight: 600;
}

/* ---------- Success Section ---------- */
.success-card {
    padding: 60px 40px;
    text-align: center;
}

.success-animation {
    margin-bottom: 24px;
}

.checkmark-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-400), var(--green-600));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: white;
    font-size: 36px;
    animation: pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-glow-green);
}

@keyframes pop-in {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.success-card h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.success-card p {
    font-size: 15px;
    color: var(--gray-500);
    margin-bottom: 28px;
}

/* ---------- Toast Notifications ---------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: white;
    box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--green-500);
    animation: slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 380px;
    font-size: 14px;
    font-weight: 500;
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.error i {
    color: var(--danger);
}

.toast.success i {
    color: var(--green-500);
}

.toast.info {
    border-left-color: var(--blue-500);
}

.toast.info i {
    color: var(--blue-500);
}

@keyframes slide-in {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slide-out {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    animation: fade-in 0.2s ease;
}

.modal {
    padding: 40px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    animation: modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.modal-lg {
    max-width: 560px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 16px;
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--blue-50);
    color: var(--blue-500);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
}

.modal-icon.success {
    background: var(--green-50);
    color: var(--green-500);
}

.modal h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--gray-800);
}

.modal p {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

@keyframes fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes modal-in {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ---------- Loading Spinner ---------- */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .nav-container {
        padding: 0 16px;
        height: 60px;
    }

    .brand-text h1 {
        font-size: 16px;
    }
    
    .nav-link span {
        display: none;
    }
    
    .main-content {
        padding: 20px 16px 40px;
    }
    
    .time {
        font-size: 44px;
    }
    
    .clock-card {
        padding: 28px 20px;
    }
    
    .form-card,
    .attendance-card,
    .report-card {
        padding: 24px 20px;
    }
    
    .time-slots {
        grid-template-columns: 1fr;
    }
    
    .steps-container {
        padding: 0;
    }
    
    .step-line {
        width: 24px;
    }
    
    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .step span {
        font-size: 9px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-50);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}
