/* TarjimLY Design System - Phase 2 */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
    /* Primary Colors - Qatar Maroon */
    --primary-color: #8A1538;
    --primary-color-rgb: 138, 21, 56;
    --primary-dark: #6d1029;
    --primary-light: #a91d47;

    /* Secondary Colors */
    --secondary-color: #F5F5F5;
    --secondary-dark: #e0e0e0;

    /* Bootstrap Overrides */
    --bs-primary: var(--primary-color);
    --bs-primary-rgb: var(--primary-color-rgb);

    /* Status Colors */
    --status-pending: #ffc107;
    --status-in-progress: #0d6efd;
    --status-review: #6f42c1;
    --status-completed: #198754;
    --status-delivered: #20c997;

    /* Typography */
    --font-arabic: 'Tajawal', sans-serif;
    --font-english: 'Inter', sans-serif;

    /* Spacing */
    --navbar-height: 70px;
}

/* ============================================
   Typography
   ============================================ */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-english);
}

[dir="rtl"] body,
[lang="ar"] body {
    font-family: var(--font-arabic);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

/* ============================================
   RTL Support
   ============================================ */
[dir="rtl"] .navbar-nav {
    padding-right: 0;
}

[dir="rtl"] .me-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

[dir="rtl"] .ms-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

[dir="rtl"] .text-start {
    text-align: right !important;
}

[dir="rtl"] .text-end {
    text-align: left !important;
}

[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    float: right;
    padding-left: 0.5rem;
    padding-right: 0;
}

/* ============================================
   Primary Color Overrides
   ============================================ */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-primary:active {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

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

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

.border-primary {
    border-color: var(--primary-color) !important;
}

/* ============================================
   Navbar Styles
   ============================================ */
.navbar {
    min-height: var(--navbar-height);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar .nav-link {
    font-weight: 500;
}

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

/* ============================================
   Card Styles
   ============================================ */
.card {
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

/* ============================================
   Status Badges
   ============================================ */
.badge-sworn {
    background-color: var(--status-completed);
    color: white;
}

.badge-available {
    background-color: var(--status-completed);
}

.badge-busy {
    background-color: var(--status-pending);
    color: #000;
}

.badge-vacation {
    background-color: #6c757d;
}

/* Order Status Badges */
.status-pending,
.badge-status-pending {
    background-color: var(--status-pending) !important;
    color: #000 !important;
}

.status-in-progress,
.badge-status-in_progress {
    background-color: var(--status-in-progress) !important;
    color: white !important;
}

.status-review,
.badge-status-review {
    background-color: var(--status-review) !important;
    color: white !important;
}

.status-completed,
.badge-status-completed {
    background-color: var(--status-completed) !important;
    color: white !important;
}

.status-delivered,
.badge-status-delivered {
    background-color: var(--status-delivered) !important;
    color: white !important;
}

/* Order Row Styling */
.order-row-pending {
    border-left: 4px solid var(--status-pending);
}

.order-row-in_progress {
    border-left: 4px solid var(--status-in-progress);
}

.order-row-review {
    border-left: 4px solid var(--status-review);
}

.order-row-completed {
    border-left: 4px solid var(--status-completed);
}

.order-row-delivered {
    border-left: 4px solid var(--status-delivered);
}

/* ============================================
   Form Styles
   ============================================ */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-color-rgb), 0.25);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ============================================
   Rating Stars
   ============================================ */
.rating-stars {
    color: #ffc107;
}

.rating-stars .bi-star-fill {
    color: #ffc107;
}

.rating-stars .bi-star {
    color: #dee2e6;
}

/* ============================================
   Chat Styles
   ============================================ */
.chat-container {
    max-height: 400px;
    overflow-y: auto;
}

.chat-message {
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 12px;
    max-width: 80%;
}

.chat-message.sent {
    background-color: var(--primary-color);
    color: white;
    margin-left: auto;
}

.chat-message.received {
    background-color: var(--secondary-color);
    margin-right: auto;
}

/* ============================================
   File Upload
   ============================================ */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(var(--primary-color-rgb), 0.05);
}

/* ============================================
   Service Cards
   ============================================ */
.service-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Translator Profile
   ============================================ */
.translator-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

/* ============================================
   Feature Cards
   ============================================ */
.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    background: white;
    transition: transform 0.2s ease;
}

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

.feature-card .icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* ============================================
   Category Grid
   ============================================ */
.category-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 12px;
    background: var(--secondary-color);
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-card:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.category-card .icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* ============================================
   Dashboard Stats
   ============================================ */
.stat-card {
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.875rem;
}

/* ============================================
   Pricing Calculator
   ============================================ */
.pricing-calculator {
    background: var(--secondary-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.price-display {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ============================================
   Filter Tags
   ============================================ */
.filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.filter-tag .remove-tag {
    margin-left: 0.5rem;
    cursor: pointer;
    opacity: 0.8;
}

.filter-tag .remove-tag:hover {
    opacity: 1;
}

/* ============================================
   Activity Feed
   ============================================ */
.activity-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item .activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
    color: var(--primary-color);
}

/* ============================================
   Footer
   ============================================ */
footer {
    margin-top: auto;
    background: #1a1a1a;
    color: #999;
}

footer a {
    color: #ccc;
    text-decoration: none;
}

footer a:hover {
    color: white;
}

/* ============================================
   Utilities
   ============================================ */
.sticky-sidebar {
    position: sticky;
    top: calc(var(--navbar-height) + 1rem);
}

.bg-secondary-light {
    background-color: var(--secondary-color);
}

.text-qatar-maroon {
    color: var(--primary-color);
}

.border-qatar-maroon {
    border-color: var(--primary-color) !important;
}

/* Loading Spinner */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Smooth transitions for HTMX */
.htmx-swapping {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.htmx-settling {
    opacity: 1;
    transition: opacity 0.2s ease-in;
}
