/* ═══════════════════════════════════════════════════════════════════════
   Tanzeem-ul-Madasir - Universal Design System
   Elegant, Professional, Educational & Religious Institution Theme
   Consistent across ALL pages including Login, Dashboard, and ڈاک Module
   ═══════════════════════════════════════════════════════════════════════ */


/* ──────────────────────────────────────────────────────────────────────
   ROOT VARIABLES - Universal Color Palette
   ────────────────────────────────────────────────────────────────────── */
:root {
    /* Primary Institutional Colors - Deep Green */
    --color-primary-deep: #1b5e20;
    --color-primary: #2e7d32;
    --color-primary-light: #43a047;
    --color-primary-lighter: #66bb6a;
    --color-primary-pale: #e8f5e9;
    
    /* Accent Colors - Gold */
    --color-accent-gold: #d4af37;
    --color-accent-gold-light: #f0d78c;
    --color-accent-amber: #ffa726;
    --color-accent-gold-pale: #fff8e1;
    
    /* Backgrounds */
    --color-bg-main: #f8faf9;
    --color-bg-soft: #f1f5f4;
    --color-bg-white: #ffffff;
    --color-bg-card: #ffffff;
    --color-bg-overlay: rgba(255, 255, 255, 0.95);
    
    /* Text Colors */
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #4a5568;
    --color-text-light: #718096;
    --color-text-muted: #a0aec0;
    --color-text-white: #ffffff;
    
    /* Status Colors */
    --color-success: #43a047;
    --color-warning: #ffa726;
    --color-error: #e53935;
    --color-info: #29b6f6;
    
    /* Borders & Dividers */
    --color-border-light: #e5e9e7;
    --color-border-medium: #cbd5d0;
    --color-divider: #e0e7e3;
    
    /* Shadows - Professional Depth */
    --shadow-xs: 0 1px 3px rgba(27, 94, 32, 0.05);
    --shadow-sm: 0 2px 8px rgba(27, 94, 32, 0.08);
    --shadow-md: 0 4px 16px rgba(27, 94, 32, 0.12);
    --shadow-lg: 0 8px 32px rgba(27, 94, 32, 0.16);
    --shadow-xl: 0 12px 48px rgba(27, 94, 32, 0.2);
    --shadow-2xl: 0 24px 64px rgba(27, 94, 32, 0.25);
    
    /* Border Radius */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Typography Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--color-primary-deep) 0%, var(--color-primary) 50%, var(--color-primary-light) 100%);
    --gradient-accent: linear-gradient(135deg, var(--color-accent-gold) 0%, var(--color-accent-gold-light) 50%, var(--color-accent-amber) 100%);
    --gradient-soft: linear-gradient(180deg, #f8faf9 0%, #e8f5e9 100%);
}

/* ──────────────────────────────────────────────────────────────────────
   GLOBAL STYLES
   ────────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Jameel Noori Nastaleeq', serif;
    direction: rtl;
    text-align: right;
    background-color: var(--color-bg-main);
    color: var(--color-text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* ──────────────────────────────────────────────────────────────────────
   TYPOGRAPHY - Consistent Urdu Font System
   ────────────────────────────────────────────────────────────────────── */
.urdu-font,
h1, h2, h3, h4, h5, h6,
.mud-text {
    font-family: 'Jameel Noori Nastaleeq', serif !important;
}

h1 { font-size: var(--text-4xl); font-weight: 700; line-height: 1.2; margin: 0; color: var(--color-text-primary); }
h2 { font-size: var(--text-3xl); font-weight: 700; line-height: 1.3; margin: 0; color: var(--color-text-primary); }
h3 { font-size: var(--text-2xl); font-weight: 700; line-height: 1.3; margin: 0; color: var(--color-text-primary); }
h4 { font-size: var(--text-xl); font-weight: 700; line-height: 1.4; margin: 0; color: var(--color-text-primary); }
h5 { font-size: var(--text-lg); font-weight: 600; line-height: 1.4; margin: 0; color: var(--color-text-primary); }
h6 { font-size: var(--text-base); font-weight: 600; line-height: 1.5; margin: 0; color: var(--color-text-primary); }

p {
    line-height: 1.8;
    margin: 0 0 var(--space-md) 0;
}

/* Font Weights */
.fw-light { font-weight: 300; }
.fw-normal { font-weight: 400; }
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }
.fw-extrabold { font-weight: 800; }

/* ──────────────────────────────────────────────────────────────────────
   RTL UTILITIES
   ────────────────────────────────────────────────────────────────────── */
.rtl-layout,
.rtl-content {
    direction: rtl !important;
    text-align: right !important;
}

.ltr-layout,
.ltr-content {
    direction: ltr !important;
    text-align: left !important;
}

/* ──────────────────────────────────────────────────────────────────────
   PROFESSIONAL PAGE HEADERS - Universal Style
   ────────────────────────────────────────────────────────────────────── */
.page-header-professional {
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-2xl);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-xl);
    animation: slideInDown 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-header-professional::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse-glow 8s ease-in-out infinite;
}

.page-header-professional::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
    border-radius: 50%;
    animation: pulse-glow 10s ease-in-out infinite reverse;
}

.page-header-content {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    position: relative;
    z-index: 10;
}

.page-header-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.page-header-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.page-header-subtitle {
    font-size: var(--text-lg);
    opacity: 0.9;
    font-weight: 500;
}

/* ──────────────────────────────────────────────────────────────────────
   PROFESSIONAL CARDS - Universal Style
   ────────────────────────────────────────────────────────────────────── */
.card-professional {
    background: var(--color-bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: var(--space-lg);
}

.card-professional:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header-professional {
    background: var(--gradient-soft);
    border-bottom: 2px solid var(--color-primary);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.card-header-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.card-header-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-primary-deep);
}

.card-body-professional {
    padding: var(--space-xl);
}

.card-footer-professional {
    padding: var(--space-lg);
    background: var(--color-bg-soft);
    border-top: 1px solid var(--color-border-light);
}

/* ──────────────────────────────────────────────────────────────────────
   PROFESSIONAL FORMS - Universal Input Styles
   ────────────────────────────────────────────────────────────────────── */
.form-professional .mud-input-root {
    direction: rtl !important;
}

.form-professional .mud-input-label,
.mud-input-label {
    right: 14px !important;
    left: auto !important;
    transform-origin: top right !important;
    font-family: 'Jameel Noori Nastaleeq', serif !important;
}

.form-professional .mud-input-outlined-label,
.mud-input-outlined-label {
    right: 14px !important;
    left: auto !important;
}

.form-professional .mud-input,
.mud-input {
    text-align: right !important;
    font-family: 'Jameel Noori Nastaleeq', serif !important;
}

.form-professional .mud-select-input,
.mud-select-input {
    text-align: right !important;
    direction: rtl;
}

.form-professional .mud-input-adornment.mud-input-adornment-start {
    margin-right: 0 !important;
    margin-left: var(--space-sm) !important;
}

/* ──────────────────────────────────────────────────────────────────────
   PROFESSIONAL TABLES - Universal Style
   ────────────────────────────────────────────────────────────────────── */
.table-professional {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-professional .mud-table-head {
    background: var(--gradient-primary);
}

.table-professional .mud-table-head .mud-table-cell {
    color: white !important;
    font-family: 'Jameel Noori Nastaleeq', serif !important;
    font-weight: 700 !important;
    padding: var(--space-lg) !important;
    text-align: center !important;
    border: none !important;
    font-size: var(--text-sm) !important;
    text-transform: none !important;
}

.table-professional tbody tr:nth-child(odd) {
    background-color: var(--color-bg-main);
}

.table-professional tbody tr:nth-child(even) {
    background-color: var(--color-bg-white);
}

.table-professional tbody tr:hover {
    background-color: var(--color-primary-pale) !important;
    transition: background-color 0.2s ease;
}

.table-professional .mud-table-cell {
    font-family: 'Jameel Noori Nastaleeq', serif !important;
    padding: var(--space-md) var(--space-lg) !important;
    border-bottom: 1px solid var(--color-border-light) !important;
    text-align: right !important;
}

/* ──────────────────────────────────────────────────────────────────────
   PROFESSIONAL BUTTONS - Universal Style
   ────────────────────────────────────────────────────────────────────── */
.btn-professional-primary {
    background: var(--gradient-primary) !important;
    color: white !important;
    font-family: 'Jameel Noori Nastaleeq', serif !important;
    font-weight: 600 !important;
    border-radius: var(--radius-md) !important;
    padding: var(--space-md) var(--space-xl) !important;
    box-shadow: var(--shadow-md) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-transform: none !important;
}

.btn-professional-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg) !important;
}

.btn-professional-accent {
    background: var(--gradient-accent) !important;
    color: var(--color-primary-deep) !important;
    font-family: 'Jameel Noori Nastaleeq', serif !important;
    font-weight: 600 !important;
    border-radius: var(--radius-md) !important;
    padding: var(--space-md) var(--space-xl) !important;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-transform: none !important;
}

.btn-professional-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.6) !important;
}

.btn-professional-secondary {
    background: white !important;
    color: var(--color-primary) !important;
    font-family: 'Jameel Noori Nastaleeq', serif !important;
    border: 2px solid var(--color-primary) !important;
    border-radius: var(--radius-md) !important;
    padding: var(--space-md) var(--space-xl) !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
}

.btn-professional-secondary:hover {
    background: var(--color-primary-pale) !important;
    transform: translateY(-1px);
}

/* ──────────────────────────────────────────────────────────────────────
   STATUS BADGES - Universal Style
   ────────────────────────────────────────────────────────────────────── */
.badge-professional {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    font-family: 'Jameel Noori Nastaleeq', serif;
}

.badge-success {
    background: var(--color-primary-pale);
    color: var(--color-primary-deep);
    border: 1px solid var(--color-primary-light);
}

.badge-warning {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffb74d;
}

.badge-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #e57373;
}

.badge-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #64b5f6;
}

.badge-gold {
    background: var(--color-accent-gold-pale);
    color: #9a7b0a;
    border: 1px solid var(--color-accent-gold-light);
}

/* Reference Badge */
.ref-badge-professional {
    background: var(--color-primary-pale);
    color: var(--color-primary-deep);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    border: 1px solid var(--color-primary-light);
    display: inline-block;
    font-family: monospace;
    letter-spacing: 0.5px;
}

/* ──────────────────────────────────────────────────────────────────────
   PROFESSIONAL ANIMATIONS
   ────────────────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

@keyframes float-particle {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.3; }
    50% { transform: translateY(-30px) rotate(180deg); opacity: 0.8; }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-in-down {
    animation: slideInDown 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* ──────────────────────────────────────────────────────────────────────
   UTILITY CLASSES
   ────────────────────────────────────────────────────────────────────── */
/* Text Colors */
.text-primary { color: var(--color-primary) !important; }
.text-primary-deep { color: var(--color-primary-deep) !important; }
.text-secondary { color: var(--color-text-secondary) !important; }
.text-light { color: var(--color-text-light) !important; }
.text-muted { color: var(--color-text-muted) !important; }
.text-white { color: var(--color-text-white) !important; }
.text-gold { color: var(--color-accent-gold) !important; }

/* Background Colors */
.bg-primary { background-color: var(--color-primary) !important; }
.bg-primary-pale { background-color: var(--color-primary-pale) !important; }
.bg-white { background-color: var(--color-bg-white) !important; }
.bg-soft { background-color: var(--color-bg-soft) !important; }
.bg-gold { background-color: var(--color-accent-gold-pale) !important; }

/* Shadows */
.shadow-xs { box-shadow: var(--shadow-xs) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }
.shadow-2xl { box-shadow: var(--shadow-2xl) !important; }

/* Border Radius */
.rounded-xs { border-radius: var(--radius-xs) !important; }
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-2xl { border-radius: var(--radius-2xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

/* Truncate Text */
.truncate-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* Text Alignment */
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }

/* ──────────────────────────────────────────────────────────────────────
   RESPONSIVE DESIGN
   ────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --text-4xl: 1.75rem;
        --text-3xl: 1.5rem;
        --text-2xl: 1.25rem;
    }
    
    .page-header-professional {
        padding: var(--space-lg);
    }
    
    .page-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .page-header-icon {
        width: 64px;
        height: 64px;
    }
    
    .card-body-professional {
        padding: var(--space-lg);
    }
}

/* ──────────────────────────────────────────────────────────────────────
   ACCESSIBILITY
   ────────────────────────────────────────────────────────────────────── */
:focus-visible {
    outline: 3px solid var(--color-accent-gold);
    outline-offset: 2px;
}

/* Ensure sufficient contrast */
*:not(.mud-table-head *) {
    color-contrast: AA;
}

/* ──────────────────────────────────────────────────────────────────────
   PRINT STYLES
   ────────────────────────────────────────────────────────────────────── */
@media print {
    .no-print,
    .mud-appbar,
    .mud-drawer {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .card-professional,
    .table-professional {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}
