/* ============================================
   IPCO Custom Styles - Modern Persian UI
   ============================================ */

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

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --success: #0d9488;
    --success-light: #ccfbf1;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --info: #06b6d4;
    --info-light: #ecfeff;
    --dark: #1e293b;
    --gray-900: #0f172a;
    --gray-800: #1e293b;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --gray-50: #f8fafc;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px 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-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.2s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'B Zar', Tahoma, Arial, sans-serif !important;
    background-color: var(--gray-50);
    color: var(--gray-800);
    direction: rtl;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    font-family: 'Vazirmatn', 'B Zar', Tahoma, Arial, sans-serif !important;
    text-align: right;
}

/* ============================================
   Navbar
   ============================================ */
.navbar {
    background: var(--white) !important;
    box-shadow: var(--shadow-md) !important;
    border-bottom: 1px solid var(--gray-200);
    padding: 0.6rem 0;
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary) !important;
    letter-spacing: -0.5px;
}

.navbar .nav-link {
    font-weight: 500;
    color: var(--gray-600) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 0.95rem;
}

.navbar .nav-link:hover {
    color: var(--primary) !important;
    background-color: var(--primary-light);
}

.navbar .nav-link.dropdown-toggle::after {
    margin-right: 0.5em;
    margin-left: 0;
}

.dropdown-menu {
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    min-width: 200px;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* ============================================
   Main Content
   ============================================ */
main.py-4 {
    padding-top: 2rem !important;
    padding-bottom: 3rem !important;
}

.container {
    max-width: 1100px;
}

/* ============================================
   Cards
   ============================================ */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: var(--white);
    overflow: hidden;
    transition: var(--transition);
    margin-bottom: 1.25rem;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--gray-800);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-100);
}

.card-body {
    padding: 1.5rem;
}

.card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
    padding: 1rem 1.5rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    font-family: 'Vazirmatn', 'B Zar', Tahoma, sans-serif;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 0.95rem;
    border: 2px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #0d47a1);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
    transform: translateY(-1px);
    color: var(--white);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
    color: var(--white);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #0f766e);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
    color: var(--white);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

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

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
}

/* ============================================
   Forms
   ============================================ */
.form-control {
    font-family: 'Vazirmatn', 'B Zar', Tahoma, sans-serif;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: var(--white);
    color: var(--gray-800);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
    outline: none;
    background-color: var(--white);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-control[readonly],
.form-control[disabled] {
    background-color: var(--gray-50);
    color: var(--gray-500);
    cursor: not-allowed;
}

.col-form-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.9rem;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border-right: 4px solid var(--danger);
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border-right: 4px solid var(--success);
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border-right: 4px solid var(--warning);
}

.alert-info {
    background: var(--info-light);
    color: #155e75;
    border-right: 4px solid var(--info);
}

/* ============================================
   Tables
   ============================================ */
.table {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table thead th {
    background: var(--gray-100);
    color: var(--gray-700);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    padding: 0.85rem 1rem;
}

.table tbody td {
    padding: 0.85rem 1rem;
    border-color: var(--gray-100);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: var(--primary-light);
}

/* ============================================
   Custom Checkbox
   ============================================ */
.custom-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ============================================
   Product Cards (Shop)
   ============================================ */
.product-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.product-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.product-card .product-info {
    flex: 1;
}

.product-card .product-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.product-card .product-desc {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.product-card .product-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    white-space: nowrap;
}

.product-card .product-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.product-card.selected .product-check {
    background: var(--primary);
    border-color: var(--primary);
}

.product-card.selected .product-check::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* ============================================
   Step Indicator
   ============================================ */
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-400);
    position: relative;
}

.step.active {
    color: var(--primary);
}

.step.completed {
    color: var(--success);
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--gray-200);
    color: var(--gray-500);
}

.step.active .step-number {
    background: var(--primary);
    color: white;
}

.step.completed .step-number {
    background: var(--success);
    color: white;
}

.step-divider {
    width: 40px;
    height: 2px;
    background: var(--gray-200);
    margin: 0 0.5rem;
}

.step-divider.active {
    background: var(--success);
}

/* ============================================
   Invoice / Confirm Page
   ============================================ */
.invoice-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px dashed var(--gray-200);
}

.invoice-header h2 {
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.invoice-header p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.invoice-section {
    margin-bottom: 1.5rem;
}

.invoice-section-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.invoice-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.invoice-row:last-child {
    border-bottom: none;
}

.invoice-total {
    background: var(--primary-light);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invoice-total .label {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary-dark);
}

.invoice-total .value {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--primary-dark);
}

/* ============================================
   Success / Error Pages
   ============================================ */
.result-container {
    text-align: center;
    padding: 3rem 1rem;
}

.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
}

.result-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.result-icon.error {
    background: var(--danger-light);
    color: var(--danger);
}

.result-title {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
}

.result-message {
    font-size: 1rem;
    color: var(--gray-500);
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* ============================================
   Welcome / Home
   ============================================ */
.welcome-container {
    text-align: center;
    padding: 2rem 1rem;
}

.welcome-title {
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    font-size: 1rem;
    color: var(--gray-500);
    margin-bottom: 2rem;
}

.welcome-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .product-card {
        padding: 1rem;
    }

    .steps {
        flex-direction: column;
        gap: 0.5rem;
    }

    .step-divider {
        display: none;
    }

    .welcome-title {
        font-size: 1.4rem;
    }

    .invoice-total {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* ============================================
   Utilities
   ============================================ */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--gray-500) !important; }

.bg-primary-light { background-color: var(--primary-light) !important; }
.bg-success-light { background-color: var(--success-light) !important; }
.bg-danger-light { background-color: var(--danger-light) !important; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.fw-bold { font-weight: 700; }
.fw-normal { font-weight: 400; }
.fw-light { font-weight: 300; }

.rounded { border-radius: var(--radius) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .product-card, .btn {
    animation: fadeIn 0.3s ease;
}

/* Money component styling */
money-input, money-label {
    font-family: 'Vazirmatn', monospace;
    font-weight: 600;
}
