/* ============================================
   Ummul Quro Exam System - Main Stylesheet
   ============================================ */

:root {
    /* Primary Colors - Islamic Green Theme */
    --primary-green: #2d5f3f;
    --primary-green-dark: #1e3f2a;
    --primary-green-light: #4a8c5f;
    --accent-green: #5cb85c;
    --accent-green-hover: #4cae4c;
    
    /* Secondary Colors */
    --gold: #d4af37;
    --gold-light: #f4d03f;
    
    /* Neutral Colors */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --gray: #6c757d;
    --dark-gray: #343a40;
    --border-gray: #dee2e6;
    
    /* Text Colors */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-light: #ffffff;
    
    /* Status Colors */
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    
    /* Typography */
    --font-primary: 'Poppins', 'Segoe UI', sans-serif;
    --font-secondary: 'Montserrat', sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --shadow-xl: 0 12px 24px rgba(0,0,0,0.18);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================
   Reset & Base Styles
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    color: var(--text-primary);
    background: var(--light-gray);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-normal);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition-normal);
}

input, textarea, select {
    font-family: inherit;
    outline: none;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-secondary);
    font-weight: 700;
    line-height: 1.3;
    color: var(--primary-green-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* ============================================
   Container & Layout
   ============================================ */

.container {
    width: 100%;
    max-width: 1550px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    padding: 0 15px;
}

/* ============================================
   Header & Navigation
   ============================================ */

.header {
    background: var(--white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition-normal);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    width: 80px;
    height: 50px;
    border-radius: 50%;
    padding: 8px;
}

.logo-text h3 {
    font-size: 1.4rem;
    color: var(--primary-green);
    margin: 0;
}

.logo-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary-green);
    background: var(--light-gray);
}

.nav-link.active {
    color: var(--primary-green);
    background: rgba(45, 95, 63, 0.1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-green);
    border-radius: 3px;
    transition: var(--transition-fast);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-align: center;
    transition: var(--transition-normal);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-green);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-green-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--accent-green);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--accent-green-hover);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
}

.btn-outline:hover {
    background: var(--primary-green);
    color: var(--white);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 15px 40px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
    display: block;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
    color: var(--white);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: movePattern 20s linear infinite;
}

@keyframes movePattern {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero h1 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    transition: var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.card-header {
    border-bottom: 2px solid var(--border-gray);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    color: var(--primary-green);
    margin: 0;
}

.card-body {
    padding: 0;
}

.card-footer {
    border-top: 1px solid var(--border-gray);
    padding-top: 1rem;
    margin-top: 1.5rem;
    text-align: center;
}

/* ============================================
   Forms
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-gray);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.form-control:disabled {
    background: var(--light-gray);
    cursor: not-allowed;
}

.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-gray);
    border-radius: var(--radius-md);
    font-size: 1rem;
    cursor: pointer;
    background: var(--white);
}

.form-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ============================================
   Tables
   ============================================ */

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.table thead {
    background: var(--primary-green);
    color: var(--white);
}

.table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-gray);
}

.table tbody tr:hover {
    background: var(--light-gray);
}

/* ============================================
   Badges & Status
   ============================================ */

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: var(--success);
    color: var(--white);
}

.badge-warning {
    background: var(--warning);
    color: var(--dark-gray);
}

.badge-danger {
    background: var(--danger);
    color: var(--white);
}

.badge-info {
    background: var(--info);
    color: var(--white);
}

.badge-primary {
    background: var(--primary-green);
    color: var(--white);
}

/* ============================================
   Alerts
   ============================================ */

.alert {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border-left: 4px solid var(--success);
    color: var(--success);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid var(--warning);
    color: #856404;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--danger);
    color: var(--danger);
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    border-left: 4px solid var(--info);
    color: var(--info);
}

/* ============================================
   Modal
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: none;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
}

.modal-close:hover {
    color: var(--danger);
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background: var(--primary-green-dark);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: 5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--gold);
    margin-bottom: 1rem;
}

.footer-section p, .footer-section a {
    color: rgba(255,255,255,0.8);
    line-height: 1.8;
}

.footer-section a:hover {
    color: var(--gold-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
}

/* ============================================
   Utilities
   ============================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* ============================================
   Loading Spinner
   ============================================ */

.spinner {
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary-green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 992px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 300px;
        height: calc(100vh - 70px);
        background: var(--white);
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow-xl);
        transition: var(--transition-normal);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .hero {
        padding: 50px 0;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th, .table td {
        padding: 10px;
    }
}

@media (max-width: 576px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .logo-text h3 {
        font-size: 1.1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}
