/**
 * TechLab Portal - Customer Portal CSS
 * RTL-optimized stylesheet for Hebrew interface
 */

/* ========================================
   RTL & Typography
   ======================================== */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --card-hover-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    
    --border-radius: 0.375rem;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f6fa;
    direction: rtl;
    text-align: right;
}

/* ========================================
   Navbar Customization
   ======================================== */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: background-color var(--transition-speed) ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

#logoutBtn {
    color: rgba(255, 255, 255, 0.9);
    background: none;
    border: none;
    padding: 0.5rem 1rem;
}

#logoutBtn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
}

/* ========================================
   Cards & Containers
   ======================================== */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed) ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-2px);
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid var(--light-color);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* Statistics Cards */
.stat-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, var(--primary-color) 0%, #0b5ed7 100%);
    color: white;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed) ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
}

.stat-card .display-4 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-card .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.9rem;
}

/* ========================================
   Forms & Inputs
   ======================================== */
.form-control,
.form-select {
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    padding: 0.625rem 0.875rem;
    transition: all var(--transition-speed) ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.form-check-input {
    margin-left: 0.5rem;
    margin-right: 0;
}

.form-check-label {
    margin-right: 0.25rem;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0b5ed7 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #157347 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #bb2d3b 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #ffca2c 100%);
    border: none;
    color: var(--dark-color);
}

/* ========================================
   Status Badges
   ======================================== */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.status-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-new,
.status-pending {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-in_progress,
.status-in_diagnosis {
    background-color: #fff3e0;
    color: #f57c00;
}

.status-waiting_approval {
    background-color: #fce4ec;
    color: #c2185b;
}

.status-approved {
    background-color: #e8f5e9;
    color: #388e3c;
}

.status-in_repair {
    background-color: #fff9c4;
    color: #f57f17;
}

.status-completed,
.status-delivered {
    background-color: #c8e6c9;
    color: #2e7d32;
}

.status-cancelled {
    background-color: #ffcdd2;
    color: #c62828;
}

/* Priority Badges */
.priority-low {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.priority-normal {
    background-color: #e3f2fd;
    color: #1976d2;
}

.priority-high {
    background-color: #fff3e0;
    color: #f57c00;
}

.priority-urgent {
    background-color: #ffebee;
    color: #c62828;
}

/* ========================================
   Loading States
   ======================================== */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15rem;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

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

.table thead th {
    background-color: var(--light-color);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    margin-top: 2rem;
}

.page-link {
    border-radius: var(--border-radius);
    margin: 0 0.25rem;
    padding: 0.5rem 0.75rem;
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ========================================
   Modals
   ======================================== */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 2px solid var(--light-color);
    padding: 1.5rem;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 2px solid var(--light-color);
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

/* ========================================
   Alerts & Messages
   ======================================== */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.alert i {
    margin-left: 0.5rem;
}

/* ========================================
   Dashboard Specific
   ======================================== */
#portalDashboard h1 {
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 2rem;
}

#dashboardContent .row {
    margin-bottom: 2rem;
}

/* Recent Repairs List */
#recentRepairs .repair-item {
    padding: 1rem;
    border-bottom: 1px solid var(--light-color);
    transition: background-color var(--transition-speed) ease;
}

#recentRepairs .repair-item:hover {
    background-color: #f8f9fa;
}

#recentRepairs .repair-item:last-child {
    border-bottom: none;
}

/* ========================================
   Repairs List
   ======================================== */
.repair-card {
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all var(--transition-speed) ease;
}

.repair-card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-2px);
    cursor: pointer;
}

.repair-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.repair-device {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.repair-info {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* ========================================
   Profile Page
   ======================================== */
#profilePage .card-header h5 {
    margin: 0;
    font-weight: 600;
}

#profilePage .form-control[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

#activeSessions .session-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--light-color);
    font-size: 0.9rem;
}

#activeSessions .session-item:last-child {
    border-bottom: none;
}

/* ========================================
   Documents Page
   ======================================== */
.document-icon {
    font-size: 2rem;
    margin-left: 1rem;
}

.document-type-invoice { color: #28a745; }
.document-type-estimate { color: #007bff; }
.document-type-warranty { color: #ffc107; }
.document-type-report { color: #6c757d; }
.document-type-receipt { color: #17a2b8; }
.document-type-other { color: #6c757d; }

/* ========================================
   Verification Page
   ======================================== */
#verifySuccess .fa-check-circle,
#verifyError .fa-times-circle {
    font-size: 4rem;
}

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

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0b5ed7 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #157347 100%);
}

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

/* RTL Specific Fixes */
.ms-auto { margin-left: 0 !important; margin-right: auto !important; }
.me-auto { margin-right: 0 !important; margin-left: auto !important; }
.text-start { text-align: right !important; }
.text-end { text-align: left !important; }

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .stat-card .display-4 {
        font-size: 2rem;
    }
    
    .navbar-nav {
        padding-top: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        margin-bottom: 0.25rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 0.9rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.4s ease-out;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .navbar,
    .btn,
    .pagination,
    footer {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}
