/* ============================================
   تصميم عصري وبسيط - قصة طفلك المخصصة
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-light: #f9fafb;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    direction: rtl;
    text-align: right;
    background: var(--bg-light);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ============================================
   اللوغو في الزاوية
   ============================================ */

.logo-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 120px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 10px;
    transition: all 0.3s ease;
}

.logo-container:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.logo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-container .logo-placeholder {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
}

/* ============================================
   الحاوية الرئيسية
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px 40px;
}

/* ============================================
   القسم الرئيسي (Hero)
   ============================================ */

.hero {
    text-align: center;
    padding: 60px 0;
    margin-bottom: 60px;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 24px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 32px;
}

/* ============================================
   الأزرار
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    min-width: 180px;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--bg-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* ============================================
   الكروت
   ============================================ */

.card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.card-item {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.card-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-item h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text);
}

.card-item p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ============================================
   النماذج
   ============================================ */

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    transition: all 0.2s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: var(--text-light);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 6px;
    display: none;
}

.error-message.show {
    display: block;
}

/* ============================================
   شريط التقدم
   ============================================ */

.progress-container {
    margin: 32px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--bg-gradient);
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

/* ============================================
   صفحة الأسئلة
   ============================================ */

.question-container {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.question-number {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.question-title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 32px;
    line-height: 1.3;
}

.question-input {
    margin-bottom: 32px;
}

.question-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 32px;
}

/* ============================================
   صفحة الشكر
   ============================================ */

.thank-you {
    text-align: center;
    padding: 60px 0;
}

.thank-you h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 24px;
}

.thank-you p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-light);
    margin-bottom: 16px;
    line-height: 1.8;
}

.order-id-box {
    background: var(--bg);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 32px auto;
    max-width: 500px;
    box-shadow: var(--shadow-md);
}

.order-id-box h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--text);
}

.order-id-value {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--bg-light);
    padding: 12px 20px;
    border-radius: var(--radius);
    display: inline-block;
    margin: 12px 0;
    letter-spacing: 1px;
}

.info-box {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin: 32px auto;
    max-width: 600px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.info-box h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text);
}

.info-box p {
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.8;
}

/* ============================================
   صفحة تتبع الطلب
   ============================================ */

.track-form {
    max-width: 500px;
    margin: 0 auto;
}

.order-status-card {
    background: var(--bg);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin: 32px auto;
    max-width: 700px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.status-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.status-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.status-message {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 32px;
    line-height: 1.8;
}

.status-info {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.status-info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.status-info-item:last-child {
    border-bottom: none;
}

.status-info-item strong {
    color: var(--text);
}

.status-steps {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 32px;
}

.status-steps h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: var(--text);
    text-align: center;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.step-item {
    text-align: center;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--bg);
    transition: all 0.3s ease;
}

.step-item.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.step-item.completed {
    background: var(--success);
    color: white;
}

.step-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.step-label {
    font-size: 0.875rem;
    font-weight: 600;
}

/* ============================================
   لوحة الإدارة
   ============================================ */

.admin-container {
    background: var(--bg-light);
    min-height: 100vh;
    padding: 100px 20px 40px;
}

.admin-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.admin-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: var(--text);
    margin-bottom: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.95rem;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.orders-table th,
.orders-table td {
    padding: 16px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.orders-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.orders-table tr:hover {
    background: var(--bg-light);
}

.orders-table tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-received { background: #dbeafe; color: #1e40af; }
.status-processing { background: #fef3c7; color: #92400e; }
.status-printed { background: #e9d5ff; color: #6b21a8; }
.status-shipping { background: #cffafe; color: #155e75; }
.status-delivered { background: #d1fae5; color: #065f46; }

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
    min-width: auto;
    margin: 4px;
}

.btn-success { background: var(--success); color: white; }
.btn-info { background: var(--primary); color: white; }

/* ============================================
   صفحة تسجيل الدخول
   ============================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-gradient);
}

.login-card {
    background: var(--bg);
    border-radius: var(--radius-xl);
    padding: 48px;
    box-shadow: var(--shadow-xl);
    max-width: 400px;
    width: 100%;
}

.login-card h1 {
    text-align: center;
    color: var(--text);
    margin-bottom: 32px;
    font-size: 1.75rem;
}

/* ============================================
   رفع اللوغو
   ============================================ */

.logo-upload-section {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.logo-upload-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text);
}

.logo-preview {
    width: 200px;
    height: 100px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    background: var(--bg-light);
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ============================================
   الأنيميشن
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .logo-container {
        top: 10px;
        right: 10px;
        width: 80px;
        height: 40px;
        padding: 6px;
    }
    
    .container {
        padding: 80px 15px 30px;
    }
    
    .card {
        padding: 24px;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .orders-table {
        font-size: 0.875rem;
    }
    
    .orders-table th,
    .orders-table td {
        padding: 12px 8px;
    }
    
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .logo-container {
        width: 60px;
        height: 30px;
    }
    
    .logo-container .logo-placeholder {
        font-size: 0.6rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .order-status-card {
        padding: 24px;
    }
}

/* ============================================
   Utilities
   ============================================ */

.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.hidden { display: none !important; }

/* ============================================
   Confetti
   ============================================ */

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 9999;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.confetti {
    animation: fall linear forwards;
}
