/*
 * التنسيق الاحترافي لصفحة هبوط المأذون
 * مستوحى من الهوية البصرية لـ elmaazon.net
 */

:root {
    /* ألوان منصة المأذون الأساسية */
    --primary: #EA9015;
    --primary-hover: #d97706;
    --primary-light: #fef3c7;
    
    --secondary: #1a1a2e;
    --secondary-light: #2a2a4a;
    
    --gradient-start: #312e81;
    --gradient-end: #4338ca;
    
    /* ألوان عامة */
    --dark: #0f172a;
    --gray-900: #1e293b;
    --gray-600: #475569;
    --gray-300: #cbd5e1;
    --gray-100: #f1f5f9;
    --bg: #ffffff;
    
    /* ألوان الحالة */
    --success: #10b981;
    --success-bg: #d1fae5;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    
    /* متغيرات أخرى */
    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    background: #fafafd;
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    font-weight: 800;
}

a {
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ═════════ Navbar ═════════ */
.navbar {
    background: var(--bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--secondary);
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Tajawal', sans-serif;
}

.logo-icon {
    color: var(--primary);
    font-size: 1.8rem;
}

.nav-btn {
    background: var(--primary);
    color: white;
    padding: 10px 24px;
    border-radius: 99px;
    font-weight: 700;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 144, 21, 0.3);
}

/* ═════════ Hero Section ═════════ */
.hero-section {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    padding: 60px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -50px;
}

.shape-2 {
    width: 500px;
    height: 500px;
    bottom: -200px;
    left: -100px;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-text {
    text-align: center;
    max-width: 800px;
    margin-bottom: 40px;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    opacity: 0.9;
    font-weight: 600;
}

/* ═════════ Result Widget ═════════ */
.result-widget-container {
    width: 100%;
    max-width: 600px;
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    color: var(--gray-900);
}

.widget-search-section {
    padding: 30px;
    background: white;
    border-bottom: 1px solid var(--gray-100);
    text-align: center;
}

.widget-header h2 {
    margin-bottom: 20px;
    color: var(--secondary);
    font-size: 1.6rem;
}

.input-group {
    display: flex;
    gap: 12px;
    background: white;
    padding: 8px;
    border-radius: 16px;
    border: 2px solid var(--gray-100);
    transition: all 0.3s;
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 10px;
}

.input-icon {
    color: var(--gray-600);
}

#api_seat_number {
    border: none;
    outline: none;
    font-size: 1.1rem;
    font-family: inherit;
    width: 100%;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.error-message {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 12px;
    border-radius: var(--radius-md);
    margin-top: 15px;
    font-weight: 600;
    font-size: 0.95rem;
}

.hidden { display: none !important; }

/* ═════════ Result Card ═════════ */
.result-card {
    padding: 30px;
    background: var(--gray-100);
}

.student-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.student-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 50px;
    height: 50px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

#res_name {
    margin: 0 0 5px;
    color: var(--secondary);
    font-size: 1.2rem;
}

.student-meta {
    font-size: 0.85rem;
    color: var(--gray-600);
    font-weight: 600;
}

.status-badge {
    padding: 8px 16px;
    border-radius: 99px;
    font-weight: 800;
    font-size: 0.95rem;
}

.status-badge.success { background: var(--success-bg); color: var(--success); }
.status-badge.danger { background: var(--danger-bg); color: var(--danger); }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-card.primary .stat-icon { background: rgba(234, 144, 21, 0.1); color: var(--primary); }
.stat-card.accent .stat-icon { background: rgba(26, 26, 46, 0.1); color: var(--secondary); }

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--gray-600);
    font-weight: 700;
}

.stat-value {
    font-size: 1.4rem;
    color: var(--secondary);
}

/* Ranks */
.section-title {
    margin: 0 0 15px;
    font-size: 1.1rem;
    color: var(--secondary);
}

.ranks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 25px;
}

.rank-item {
    background: white;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--primary-light);
}

.rank-title {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 5px;
    font-weight: 700;
}

.rank-num {
    font-size: 1.3rem;
    color: var(--primary);
}

/* Subjects */
.subjects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.subject-item {
    display: flex;
    justify-content: space-between;
    background: white;
    padding: 12px 15px;
    border-radius: 10px;
    font-weight: 700;
    border-right: 4px solid var(--gray-300);
}

.subject-item.passed { border-right-color: var(--success); }
.subject-item.failed { border-right-color: var(--danger); }

/* ═════════ Marketing Section ═════════ */
.marketing-section {
    padding: 80px 0;
    background: white;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 50px;
}

.section-header h2 {
    font-size: 2.2rem;
    color: var(--secondary);
    margin-bottom: 15px;
}

.highlight {
    color: var(--primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.feature-card {
    background: var(--gray-100);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: var(--bg);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-sm);
}

.feature-card h3 {
    margin-bottom: 15px;
    color: var(--secondary);
    font-size: 1.3rem;
}

.cta-box {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    color: white;
}

.cta-box h3 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary-light);
}

.cta-box p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-cta {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 15px 35px;
    border-radius: 99px;
    font-size: 1.2rem;
    font-weight: 800;
    transition: all 0.3s;
}

.btn-cta:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

/* ═════════ Footer ═════════ */
.footer {
    background: var(--secondary);
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand .logo {
    color: white;
    margin-bottom: 5px;
}

.footer-brand .logo-icon {
    color: var(--primary);
}

.footer-links {
    display: flex;
    gap: 15px;
}

.footer-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.footer-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    font-size: 0.9rem;
    color: var(--gray-300);
}

/* ═════════ Actions / Marketing ═════════ */
.result-actions-container {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px dashed var(--gray-300);
    text-align: center;
}

.share-title {
    font-size: 1.1rem;
    color: var(--secondary);
    margin-bottom: 15px;
    font-weight: 800;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 10px 20px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.action-btn i { font-size: 1.1rem; }
.action-btn:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

.btn-whatsapp { background: #25D366; }
.btn-whatsapp:hover { background: #1ebd5a; }

.btn-facebook { background: #1877F2; }
.btn-facebook:hover { background: #166fe5; }

.btn-copy { background: var(--secondary); }
.btn-copy:hover { background: #111122; }

.btn-print { background: var(--gray-600); }
.btn-print:hover { background: var(--gray-900); }

/* ═════════ Animations ═════════ */
@keyframes spin { 100% { transform: rotate(360deg); } }
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ═════════ Responsive ═════════ */
@media (max-width: 768px) {
    .student-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .cta-box {
        padding: 30px 20px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
}
