/* ============================================================
   المنار للتكوين المهني - Custom Styles
   ============================================================ */

/* CSS Variables */
:root {
    --brand-primary: #0bd1af;
    --brand-secondary: #0da5ce;
    --brand-dark: #0a8c7a;
    --brand-light: #c2f5eb;
    --brand-pale: #eafcf8;
    --brand-gradient: linear-gradient(45deg, #0bd1af, #0da5ce);
}

/* ============================================================
   Base Font
   ============================================================ */

body, input, textarea, select, button {
    font-family: 'Cairo', 'Tajawal', 'Roboto', Arial, sans-serif;
}

/* ============================================================
   Arabic / RTL Fixes
   ============================================================ */

/* Force RTL on public pages */
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
    text-align: right;
}

/* LTR fields within RTL layout */
input[dir="ltr"],
textarea[dir="ltr"] {
    text-align: left;
    direction: ltr;
}

/* Remove number input arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Date input consistent styling */
input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ============================================================
   Form Styling
   ============================================================ */

/* Focus ring for brand color */
.focus-brand:focus {
    outline: none;
    ring: 2px;
    ring-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* Error state */
.input-error {
    border-color: #f87171 !important;
    background-color: #fef2f2 !important;
}

/* Success state */
.input-success {
    border-color: #0bd1af !important;
    background-color: #eafcf8 !important;
}

/* Animated error messages */
.error-message {
    animation: fadeInDown 0.2s ease-out;
}

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

/* ============================================================
   Button Styles
   ============================================================ */

.btn-primary {
    background-color: var(--brand-primary);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background-color: var(--brand-dark);
    box-shadow: 0 4px 12px rgba(11, 209, 175, 0.35);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Loading state */
.btn-loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: not-allowed;
}

/* ============================================================
   Card Styles
   ============================================================ */

.card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    font-weight: 600;
    color: #111827;
}

/* ============================================================
   Table Styles
   ============================================================ */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    text-align: right;
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

/* ============================================================
   Badge Styles
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-green {
    background: #c2f5eb;
    color: #076a5c;
}

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.badge-red {
    background: #fee2e2;
    color: #991b1b;
}

.badge-gray {
    background: #f3f4f6;
    color: #4b5563;
}

/* ============================================================
   Print Styles
   ============================================================ */

@media print {
    /* Hide navigation and non-essential elements */
    nav,
    header.no-print,
    footer,
    .no-print,
    .sidebar,
    aside,
    button[type="button"],
    .print-hide {
        display: none !important;
    }

    body {
        background: white !important;
        font-size: 11pt;
        color: #000;
    }

    .page-break {
        page-break-after: always;
    }

    a {
        text-decoration: none !important;
        color: inherit !important;
    }

    /* Show print-only elements */
    .print-only {
        display: block !important;
    }

    @page {
        margin: 15mm;
        size: A4;
    }
}

/* ============================================================
   Registration Number Display
   ============================================================ */

.reg-number-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--brand-primary);
}

/* ============================================================
   Sidebar Navigation (Admin)
   ============================================================ */

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #d1d5db;
    transition: all 0.15s ease;
    text-decoration: none;
    font-size: 0.875rem;
}

.sidebar-nav-item:hover {
    background: #374151;
    color: #fff;
}

.sidebar-nav-item.active {
    background: var(--brand-primary);
    color: white;
}

/* ============================================================
   Stat Cards
   ============================================================ */

.stat-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-card .stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* ============================================================
   Flash Messages
   ============================================================ */

.flash-success {
    background: #eafcf8;
    border: 1px solid #85ebd7;
    color: #076a5c;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    animation: slideIn 0.3s ease;
}

.flash-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    animation: slideIn 0.3s ease;
}

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

/* ============================================================
   Responsive Helpers
   ============================================================ */

@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }

    .data-table {
        font-size: 0.75rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem 0.5rem;
    }
}

/* ============================================================
   Scrollbar Styling
   ============================================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ============================================================
   Transitions
   ============================================================ */

* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Disable transition on page load */
.no-transition * {
    transition: none !important;
}
