/* Twindix Brand Colors */
:root {
    /* Primary Colors */
    --blue-900: #0A3380;
    --blue-800: #0F439E;
    --blue-700: #1356BC;
    --blue-600: #176ADA;
    --blue-500: #1D7EF8;
    --blue-400: #3DA5FA;
    --blue-300: #61B5FB;
    --blue-200: #8EC9FC;
    --blue-100: #BBDDFD;
    --blue-50: #E3F0FE;
    
    /* Gradient */
    --gradient-start: #005FF1;
    --gradient-end: #000000;
    
    /* Neutral Colors */
    --black: #000000;
    --charcoal-gray: #3A3A3A;
    --dark-gray: #666666;
    --light-gray: #868686;
    
    /* Accent Colors */
    --yellow: #C9A100;
    --green: #00AE2C;
    --red: #FF0000;
    
    /* Semantic Colors */
    --primary: var(--blue-900);
    --primary-hover: var(--blue-800);
    --secondary: var(--blue-600);
    --success: var(--green);
    --warning: var(--yellow);
    --danger: var(--red);
    --error: var(--red);
    --text-primary: var(--charcoal-gray);
    --text-secondary: var(--dark-gray);
    --text-light: var(--light-gray);
    --border-color: #E0E0E0;
    --border-hover: var(--light-gray);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #f5f7fa;
}

/* Arabic Font Support */
body[dir="rtl"] {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', sans-serif;
}

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

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* Header & Navigation */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.navbar-actions:empty {
    display: none;
}

.logo img {
    height: 50px;
    width: auto;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 8px;
    background: var(--blue-50);
    padding: 4px;
    border-radius: 7px;
}

.language-switcher button {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.1;
    transition: all 0.3s;
}

.language-switcher button.active {
    background: var(--primary);
    color: white;
}

.language-switcher button:hover:not(.active) {
    background: var(--blue-100);
}

/* Progress Bar */
.progress-bar-container {
    background: white;
    padding: 20px 0;
    margin-bottom: 30px;
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--blue-100);
    z-index: 0;
}

.progress-bar-fill {
    position: absolute;
    top: 20px;
    left: 0;
    height: 3px;
    background: var(--primary);
    z-index: 1;
    transition: width 0.5s ease;
}

/* RTL Support for Progress Bar */
[dir="rtl"] .progress-bar-fill {
    left: auto;
    right: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.progress-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--blue-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-light);
    transition: all 0.3s;
}

.progress-step.active .progress-step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.progress-step.completed .progress-step-circle {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.progress-step-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 100px;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(10, 51, 128, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--blue-700);
}

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

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-large {
    padding: 16px 40px;
    font-size: 18px;
}

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

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--blue-50);
}

.card-title {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 10px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

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

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 51, 128, 0.1);
}

.form-control:disabled {
    background: #f9fafb;
    cursor: not-allowed;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.form-check label {
    cursor: pointer;
    user-select: none;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin: 20px 0;
}

/* LTR table alignment */
[dir="ltr"] .table th,
[dir="ltr"] .table td {
    text-align: left;
}

/* Wider actions column for English */
[dir="ltr"] .service-table th:last-child,
[dir="ltr"] .service-table td:last-child {
    min-width: 200px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table thead {
    background: var(--blue-50);
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    font-weight: 600;
    color: var(--primary);
}

.table tbody tr:hover {
    background: var(--blue-50);
}

/* RTL Support */
[dir="rtl"] .table th,
[dir="rtl"] .table td {
    text-align: right;
}

/* Accordion */
.accordion {
    margin: 20px 0;
}

.accordion-item {
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.accordion-header {
    padding: 20px;
    background: var(--blue-50);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.accordion-header:hover {
    background: var(--blue-100);
}

.accordion-header.active {
    background: var(--primary);
    color: white;
}

.accordion-title {
    font-size: 18px;
    font-weight: 600;
}

.accordion-icon {
    font-size: 20px;
    transition: transform 0.3s;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.active {
    max-height: 2000px;
}

.accordion-body {
    padding: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 2px solid var(--blue-50);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-title {
    font-size: 24px;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--blue-50);
    color: var(--primary);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid var(--blue-50);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    flex-shrink: 0;
    background: white;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.badge-success {
    background: var(--green);
    color: white;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-warning {
    background: var(--yellow);
    color: white;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.alert-info {
    background: var(--blue-50);
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

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

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

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

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-4 { margin-top: 40px; }
.mt-5 { margin-top: 50px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }
.mb-5 { margin-bottom: 50px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }
.p-4 { padding: 40px; }
.p-5 { padding: 50px; }

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.align-center {
    align-items: center;
}

.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.gap-3 { gap: 30px; }

.grid {
    display: grid;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .progress-bar {
        flex-wrap: wrap;
    }
    
    .progress-step-label {
        font-size: 10px;
    }
}

/* Cart Continue Section */
.continue-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 20px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cart-summary {
    display: flex;
    align-items: center;
    gap: 30px;
}

.cart-count {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.cart-count span {
    font-size: 24px;
    font-weight: 700;
}

.cart-total {
    font-size: 18px;
    color: var(--text-secondary);
}

.cart-total span {
    font-weight: 700;
    color: var(--primary);
}

/* Add padding to body to prevent content from being hidden behind fixed cart */
body.has-cart-section {
    padding-bottom: 100px;
}

@media (max-width: 768px) {
    .continue-section {
        flex-direction: column;
        padding: 15px;
    }
    
    .cart-summary {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        text-align: center;
    }
    
    .continue-section .btn {
        width: 100%;
    }
}

/* Service Actions Buttons */
.service-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
}

.service-actions .btn {
    white-space: nowrap;
}

/* RTL Support for Service Actions */
[dir="rtl"] .service-actions {
    justify-content: flex-start;
}

/* Header Quotation Cart */
.header-quotation {
    display: flex;
    align-items: center;
    margin: 0 20px;
}

.quotation-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s;
}

.quotation-link:hover {
    background: var(--blue-50);
    color: var(--primary);
}

.quotation-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.quotation-icon svg {
    width: 28px;
    height: 28px;
}

.quotation-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.quotation-text {
    font-weight: 600;
    font-size: 15px;
}

/* RTL Support */
[dir="rtl"] .quotation-badge {
    right: auto;
    left: -8px;
}

[dir="rtl"] .header-quotation {
    margin: 0 20px 0 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-quotation {
        margin: 0 10px;
    }
    
    .quotation-text {
        display: none;
    }
}

/* Header Logout Button */
.header-logout {
    display: flex;
    align-items: center;
    margin-left: 15px;
}

[dir="rtl"] .header-logout {
    margin-left: 0;
    margin-right: 15px;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
}

.logout-btn:hover {
    background: var(--danger);
    color: white;
}

.logout-btn svg {
    width: 20px;
    height: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-logout {
        margin-left: 10px;
    }
    
    [dir="rtl"] .header-logout {
        margin-right: 10px;
    }
    
    .logout-btn span {
        display: none;
    }
    
    .logout-btn {
        padding: 8px;
    }
}

/* Pagination */
.tw-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.tw-pagination__info {
    font-size: 14px;
    color: var(--text-secondary);
}

.tw-pagination__list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.tw-pagination__link,
.tw-pagination__span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}

.tw-pagination__link:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--blue-50);
}

.tw-pagination__item--active .tw-pagination__span {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.tw-pagination__item--disabled .tw-pagination__span {
    opacity: 0.55;
    cursor: not-allowed;
}

.tw-pagination__icon {
    width: 16px;
    height: 16px;
    display: block;
}

[dir="rtl"] .tw-pagination__icon {
    transform: scaleX(-1);
}
