/* ==============================================================================
   UGCMS - Theme (University of Gezira Conference Management System)
   Font: Cairo | Colors from UofG + SDG Conference logos
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* الأخضر الجامعي */
    --uofg-green-900: #0a3d1f;
    --uofg-green-800: #0f4422;
    --uofg-green-700: #15803d;
    --uofg-green-600: #16a34a;
    --uofg-green-500: #22c55e;
    --uofg-green-100: #dcfce7;
    --uofg-green-50:  #f0fdf4;

    /* الذهبي */
    --uofg-gold-800: #854d0e;
    --uofg-gold-700: #a16207;
    --uofg-gold-600: #d4a017;
    --uofg-gold-500: #f59e0b;
    --uofg-gold-100: #fef3c7;

    /* الأحمر السوداني */
    --sd-red:        #c1272d;
    --sd-red-dark:   #991b1b;

    /* الأزرق */
    --uofg-blue:     #0066b3;

    /* المحايد */
    --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;

    /* الحالات */
    --success: #15803d;
    --warning: #d97706;
    --danger:  #dc2626;
    --info:    #0284c7;

    /* الظلال */
    --shadow-xs: 0 1px 2px rgba(15,68,34,0.05);
    --shadow-sm: 0 2px 6px rgba(15,68,34,0.08);
    --shadow-md: 0 6px 16px rgba(15,68,34,0.10);
    --shadow-lg: 0 14px 40px rgba(15,68,34,0.15);
    --shadow-xl: 0 24px 60px rgba(15,68,34,0.20);

    /* الزوايا */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* الانتقالات */
    --t-fast: 0.15s ease;
    --t-base: 0.25s ease;
    --t-slow: 0.4s ease;

    --font-cairo: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-cairo);
    font-size: 15px;
    line-height: 1.7;
    color: var(--gray-900);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--t-fast); }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============ الحاويات ============ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow { max-width: 900px; margin: 0 auto; padding: 0 24px; }
.container-wide   { max-width: 1440px; margin: 0 auto; padding: 0 24px; }

/* ============ شريط الهوية العلوي ============ */
.top-identity-bar {
    background: linear-gradient(135deg, var(--uofg-green-900) 0%, var(--uofg-green-800) 100%);
    color: #fff;
    font-size: 12.5px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.top-identity-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.identity-text { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.identity-sep  { opacity: 0.5; }

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(0,0,0,0.25);
    color: var(--uofg-gold-500);
    border-radius: var(--radius-sm);
    font-weight: 700;
    transition: all var(--t-fast);
}
.lang-switch:hover { background: rgba(0,0,0,0.4); color: var(--uofg-gold-100); }

/* ============ الترويسة الرئيسية ============ */
.main-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-xs);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
    padding: 10px 0;
}

/* ============ الشعارات + النص ============ */
.brand-group {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.brand-logo {
    height: 56px;
    width: auto;
    object-fit: contain;
    transition: transform var(--t-base);
    filter: drop-shadow(0 2px 6px rgba(15,68,34,0.15));
}

.brand-group:hover .brand-logo { transform: scale(1.05); }

.brand-text-block { display: flex; flex-direction: column; }

.brand-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--uofg-green-900);
    line-height: 1.25;
    margin: 0;
}

.brand-subtitle {
    font-size: 11.5px;
    color: var(--uofg-gold-700);
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* ============ القائمة الرئيسية ============ */
.main-nav { flex: 1; display: flex; justify-content: center; }

.nav-list {
    display: flex;
    gap: 6px;
    list-style: none;
}

.nav-list a {
    display: inline-block;
    padding: 8px 14px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--gray-600);
    border-radius: var(--radius-md);
    transition: all var(--t-fast);
}

.nav-list a:hover { color: var(--uofg-green-800); background: var(--uofg-green-50); }
.nav-list a.active { color: var(--uofg-green-800); background: var(--uofg-green-50); }

/* ============ أزرار الترويسة ============ */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ============ الأزرار ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-cairo);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all var(--t-base);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(135deg, var(--uofg-green-800) 0%, var(--uofg-green-700) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(15,68,34,0.20);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--uofg-green-900) 0%, var(--uofg-green-800) 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15,68,34,0.28);
}

.btn-gold {
    background: linear-gradient(135deg, var(--uofg-gold-600) 0%, var(--uofg-gold-500) 100%);
    color: var(--uofg-green-900);
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(212,160,23,0.28);
}
.btn-gold:hover:not(:disabled) {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(212,160,23,0.35);
}

.btn-outline {
    background: #fff;
    color: var(--uofg-green-800);
    border: 2px solid var(--uofg-green-700);
}
.btn-outline:hover:not(:disabled) { background: var(--uofg-green-50); }

.btn-ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.35);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.12); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--sd-red-dark); }

.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn-lg { padding: 14px 30px; font-size: 15.5px; }

/* ============ بطاقة المستخدم ============ */
.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gray-100);
    font-size: 18px;
    transition: all var(--t-fast);
}
.notification-bell:hover { background: var(--uofg-green-100); }

.badge-count {
    position: absolute;
    top: -2px;
    inset-inline-end: -2px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.user-menu { position: relative; }

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--t-fast);
    font-family: inherit;
}
.user-menu-trigger:hover { background: var(--uofg-green-50); border-color: var(--uofg-green-600); }

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--uofg-green-800), var(--uofg-green-700));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-info { display: flex; flex-direction: column; line-height: 1.2; text-align: start; }
.user-name  { font-size: 12.5px; font-weight: 800; color: var(--gray-900); }
.user-email { font-size: 10.5px; color: var(--gray-500); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-caret { color: var(--gray-500); font-size: 10px; }

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-end: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all var(--t-base);
    z-index: 1100;
}

.user-menu.open .user-menu-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.user-menu-dropdown a,
.user-menu-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: start;
    font-family: inherit;
    transition: all var(--t-fast);
}
.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover { background: var(--uofg-green-50); color: var(--uofg-green-900); }

.dropdown-divider { height: 1px; background: var(--gray-200); margin: 6px 4px; }
.dropdown-logout { color: var(--sd-red) !important; }
.dropdown-logout:hover { background: #fee2e2 !important; color: var(--sd-red-dark) !important; }

/* ============ رسائل الفلاش ============ */
.flash-message {
    padding: 14px 0;
    font-size: 14px;
    font-weight: 700;
    position: relative;
    animation: slideDown 0.3s ease-out;
}

.flash-success { background: var(--uofg-green-100); color: var(--uofg-green-900); border-bottom: 1px solid var(--uofg-green-500); }
.flash-error   { background: #fee2e2; color: var(--sd-red-dark); border-bottom: 1px solid var(--danger); }

.flash-close {
    position: absolute;
    inset-inline-end: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0 8px;
}
.flash-close:hover { opacity: 1; }

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ============ التذييل ============ */
.main-footer {
    background: linear-gradient(180deg, #0f172a 0%, #082032 100%);
    color: var(--gray-300);
    padding: 60px 0 24px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
    gap: 36px;
    margin-bottom: 40px;
}

.footer-col-brand .footer-logos { margin-bottom: 14px; }
.footer-logo { height: 60px; width: auto; filter: brightness(1.05); }

.footer-brand-title {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.4;
}

.footer-brand-desc { font-size: 13px; line-height: 1.75; color: var(--gray-400); }

.footer-heading {
    font-size: 14px;
    font-weight: 800;
    color: var(--uofg-gold-500);
    margin-bottom: 14px;
    letter-spacing: 0.3px;
}

.footer-links, .footer-contact { list-style: none; }
.footer-links li, .footer-contact li {
    font-size: 13px;
    line-height: 2;
    color: var(--gray-400);
}
.footer-links a { color: var(--gray-400); transition: color var(--t-fast); }
.footer-links a:hover { color: var(--uofg-gold-500); }
.footer-contact a { color: var(--uofg-gold-500); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--gray-500);
}

.footer-powered { color: var(--gray-600); }

/* ============ زر العودة للأعلى ============ */
.back-to-top {
    position: fixed;
    bottom: 24px;
    inset-inline-end: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--uofg-green-800);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--t-base);
    z-index: 900;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--uofg-green-900); transform: translateY(-2px); }

/* ============ الحركات ============ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

/* ============ أدوات مساعدة ============ */
.text-center { text-align: center; }
.text-start  { text-align: start; }
.text-end    { text-align: end; }
.mb-0  { margin-bottom: 0; }
.mb-1  { margin-bottom: 8px; }
.mb-2  { margin-bottom: 16px; }
.mb-3  { margin-bottom: 24px; }
.mb-4  { margin-bottom: 32px; }
.mt-3  { margin-top: 24px; }
.mt-4  { margin-top: 32px; }
.hidden { display: none !important; }

/* ============ الاستجابة ============ */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .main-nav { display: none; }
    .user-info { display: none; }
    .brand-title { font-size: 15px; }
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .top-identity-text { font-size: 11px; }
    .brand-title { font-size: 14px; }
    .brand-subtitle { font-size: 10.5px; }
    .brand-logo { height: 46px; }
    .footer-grid { grid-template-columns: 1fr; gap: 26px; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .header-actions .btn span { display: none; }
}

/* ============ الطباعة ============ */
@media print {
    .main-header, .main-footer, .top-identity-bar, .back-to-top,
    .header-actions, .flash-message { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}