/* ============================================================
   style.css - استایل‌های مشترک تمام صفحات
   ============================================================ */

/* ---------- متغیرها ---------- */
:root {
    --primary-orange: #f97316;
    --orange-dark: #ea580c;
    --orange-light: #fed7aa;
    --dark-blue: #1e293b;
    --medium-blue: #475569;
    --light-blue: #64748b;
    --background-light: #fff7ed;
    --background-lighter: #ffedd5;
    --border-color: #e2e8f0;
    --error-red: #ef4444;
    --warning-yellow: #f59e0b;
    --success-green: #10b981;
    --info-blue: #3b82f6;
}

/* ---------- Reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--background-light) 0%, var(--background-lighter) 100%);
    min-height: 100vh;
    color: var(--dark-blue);
    direction: rtl;
    text-align: right;
}

/* ---------- دکمه‌ها ---------- */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: 'Vazir', 'Iranian Sans', sans-serif;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--orange-dark) 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(249, 115, 22, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--orange-dark) 0%, #c2410c 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--primary-orange);
    border: 2px solid var(--primary-orange);
}

.btn-outline:hover {
    background: var(--primary-orange);
    color: white;
    transform: translateY(-3px);
}

/* ---------- کانتینر ---------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- کارت‌ها ---------- */
.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-right: 4px solid var(--primary-orange);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-title {
    font-size: 1.3rem;
    color: var(--dark-blue);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--orange-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--primary-orange);
}

/* ---------- فرم‌ها ---------- */
.input-group {
    margin-bottom: 25px;
    text-align: right;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-blue);
    font-size: 1rem;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--medium-blue);
    font-size: 1.1rem;
}

.input-with-icon input,
.input-with-icon select,
.input-with-icon textarea {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background-color: #f8fafc;
    color: var(--medium-blue);
    font-family: 'Vazir', sans-serif;
}

.input-with-icon input:focus,
.input-with-icon select:focus,
.input-with-icon textarea:focus {
    border-color: var(--primary-orange);
    background-color: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.input-error {
    border-color: var(--error-red) !important;
}

.input-success {
    border-color: var(--success-green) !important;
}

.error-message {
    color: var(--error-red);
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

/* ---------- پاپ‌آپ ---------- */
.popup-container {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 9999;
    max-width: 400px;
}

.popup {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-right: 5px solid;
    animation: slideInRight 0.5s ease, fadeOut 0.5s ease 9.5s forwards;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transform: translateX(120%);
    animation-fill-mode: forwards;
    position: relative;
    overflow: hidden;
}

.popup.success {
    border-color: var(--success-green);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.popup.error {
    border-color: var(--error-red);
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.popup.warning {
    border-color: var(--warning-yellow);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.popup.info {
    border-color: var(--info-blue);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.popup-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.popup.success .popup-icon {
    background-color: var(--success-green);
    color: white;
}

.popup.error .popup-icon {
    background-color: var(--error-red);
    color: white;
}

.popup.warning .popup-icon {
    background-color: var(--warning-yellow);
    color: white;
}

.popup.info .popup-icon {
    background-color: var(--info-blue);
    color: white;
}

.popup-content {
    flex: 1;
}

.popup-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 5px;
}

.popup-message {
    font-size: 14px;
    color: var(--medium-blue);
    line-height: 1.5;
    white-space: pre-line;
}

.popup-close {
    background: none;
    border: none;
    color: var(--light-blue);
    cursor: pointer;
    font-size: 18px;
    transition: color 0.3s;
    padding: 0;
    line-height: 1;
}

.popup-close:hover {
    color: var(--error-red);
}

.popup-timer {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.popup-timer-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: timerBar 10s linear forwards;
}

.popup.success .popup-timer-bar {
    background-color: var(--success-green);
}

.popup.error .popup-timer-bar {
    background-color: var(--error-red);
}

.popup.warning .popup-timer-bar {
    background-color: var(--warning-yellow);
}

.popup.info .popup-timer-bar {
    background-color: var(--info-blue);
}

/* ---------- انیمیشن‌ها ---------- */
@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

@keyframes timerBar {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 768px) {
    .popup-container {
        top: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .popup {
        padding: 15px;
    }
    .input-with-icon input,
    .input-with-icon select,
    .input-with-icon textarea {
        padding: 12px 45px 12px 15px;
    }
}