/* ==========================================================
   Modern CSS Design System for MIT Forum Platform
   Author: Antigravity
   ========================================================== */

/* Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Color Palette - HSL values for seamless blending */
    --primary-h: 140;
    --primary-s: 59%;
    --primary-l: 30%; /* MIT Green: #1F7A3A */
    
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-hover: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 5%));
    --primary-light: hsl(var(--primary-h), var(--primary-s), 95%);
    --primary-glow: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.15);
    
    --dark: #0f172a;
    --dark-surface: #1e293b;
    --light-bg: #f8fafc;
    --light-surface: #ffffff;
    
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    
    --border-color: #e2e8f0;
    --border-color-dark: #334155;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Inter', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-ar);
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

body.en-font {
    font-family: var(--font-en);
}

/* Header & Banner styling */
.main-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 0.75rem;
}

.logo-text {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    list-style: none;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

/* Hero Section */
.hero-banner {
    position: relative;
    padding: 6rem 2rem;
    background: linear-gradient(135deg, hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.9) 0%, #0f172a 100%), 
                url('/assets/images/pattern.png');
    background-size: cover;
    background-position: center;
    color: var(--text-light);
    text-align: center;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    max-width: 700px;
    margin: 0 auto 2rem auto;
    opacity: 0.9;
}

.hero-meta {
    display: inline-flex;
    gap: 1.5rem;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.15);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto 5rem auto;
    padding: 0 2rem;
}

/* Section Title */
.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

body[dir="ltr"] .section-title::after {
    right: auto;
    left: 0;
}

html[dir="ltr"] .admin-table th,
html[dir="ltr"] .admin-table td {
    text-align: left;
}

html[dir="ltr"] .admin-sidebar {
    border-left: none;
    border-right: 1px solid #1e293b;
}

html[dir="ltr"] .hero-meta {
    direction: ltr;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.service-card {
    background: var(--light-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
    transform: scaleX(0);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.04);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.service-card:hover .card-icon {
    background: var(--primary);
    color: var(--text-light);
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.card-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Modern Form styles */
.form-wrapper {
    background: var(--light-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 3rem 2.5rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-grid.full-width {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.span-2 {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-group.span-2 {
        grid-column: span 1;
    }
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-dark);
    background-color: var(--light-bg);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--light-surface);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-error {
    font-size: 0.85rem;
    color: var(--danger);
    font-weight: 500;
}

/* Modern Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-light);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Stands Map SVG Interactive styling */
.map-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #f1f5f9;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.stands-svg {
    max-width: 100%;
    height: auto;
}

.svg-stand {
    cursor: pointer;
    transition: var(--transition);
    stroke: #ffffff;
    stroke-width: 2;
    rx: 4px;
    ry: 4px;
}

.svg-stand.available {
    fill: #10b981; /* Green */
}

.svg-stand.available:hover {
    fill: #059669;
    filter: drop-shadow(0 4px 8px rgba(16,185,129,0.4));
}

.svg-stand.booked {
    fill: #ef4444; /* Red */
    cursor: not-allowed;
}

.svg-stand.temporary {
    fill: #f59e0b; /* Yellow */
    cursor: not-allowed;
}

.svg-stand.selected {
    fill: #3b82f6; /* Blue */
    stroke: #1d4ed8;
    stroke-width: 3;
    animation: pulse 1.5s infinite;
}

.svg-text {
    font-family: var(--font-en);
    font-weight: 800;
    font-size: 11px;
    fill: #ffffff;
    text-anchor: middle;
    pointer-events: none;
    user-select: none;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Badge Template styling (A6 printing) */
.badge-preview-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.badge-card {
    width: 380px;
    height: 560px;
    background: var(--light-surface);
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    position: relative;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    background-image: linear-gradient(180deg, var(--primary-light) 0%, #ffffff 40%);
}

.badge-header {
    text-align: center;
    width: 100%;
}

.badge-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.badge-event-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.badge-body {
    text-align: center;
    margin: 1.5rem 0;
}

.badge-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.badge-company {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.badge-qr {
    margin: 1.5rem 0;
    width: 140px;
    height: 140px;
    padding: 5px;
    border: 1px solid var(--border-color);
    background: #fff;
}

.badge-footer {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-footer.badge-participant {
    background: #3b82f6; /* Blue */
}
.badge-footer.badge-exposant {
    background: var(--primary); /* Green */
}
.badge-footer.badge-sponsor {
    background: #8b5cf6; /* Purple */
}
.badge-footer.badge-b2b {
    background: #f59e0b; /* Orange */
}

/* Printing optimization */
@media print {
    body * {
        visibility: hidden;
    }
    .badge-card, .badge-card * {
        visibility: visible;
    }
    .badge-card {
        position: absolute;
        left: 0;
        top: 0;
        border: none;
        box-shadow: none;
        width: 100%;
        height: 100%;
    }
    .no-print {
        display: none !important;
    }
}

/* Footer Section */
.main-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid #1e293b;
    margin-top: auto;
}

.footer-logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 1rem;
}

.footer-copy {
    font-size: 0.9rem;
}
