/* Custom CSS for Quotation System */

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .navbar-nav {
    margin-right: auto;
    margin-left: 0;
}

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

/* Language loading indicator */
.language-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.language-loading i {
    font-size: 3rem;
    color: white;
}

/* Required Fields Styling */
.required-field {
    border: 2px solid #ffcccc !important; /* Even lighter red - 75% less intense */
    transition: border-color 0.3s ease;
}

.required-field:focus {
    border-color: #ffcccc !important; /* Even lighter red - 75% less intense */
    box-shadow: 0 0 0 0.2rem rgba(255, 204, 204, 0.25); /* Even lighter red shadow */
}

.required-field.has-value {
    border-color: #0d6efd !important;
}

.required-field.has-value:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Modal Title with Request Code Badge */
.modal-title .badge {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Compact Form Fields */
#quotationForm .form-control {
    height: 34.5px; /* Increased by 15% from 30px */
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    font-size: 14px;
    line-height: 1;
    font-family: inherit;
}

#quotationForm .form-select {
    height: 34.5px; /* Increased by 15% from 30px */
    padding-top: 0px;
    padding-bottom: 0px;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 14px;
    line-height: 1;
    font-family: inherit;
}

#quotationForm select.form-control {
    height: 34.5px; /* Increased by 15% from 30px */
    padding-top: 0px;
    padding-bottom: 0px;
    padding-left: 6px;
    padding-right: 6px;
}

#quotationForm textarea.form-control {
    height: auto;
    min-height: 57.5px; /* Increased by 15% from 50px */
    line-height: 1.3;
}

#quotationForm .mb-3 {
    margin-bottom: 0.5rem !important;
}

#quotationForm .row {
    margin-bottom: 0.25rem;
}

#quotationForm .compact-row + .compact-row {
    margin-top: -0.25rem;
}

#quotationForm h6.small {
    font-size: 12px;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    color: #666;
}

/* Dimension Fields in one row */
#quotationForm .dimension-group .input-group-text {
    padding: 0.1rem 0.25rem;
    font-size: 12px;
    background-color: #f8f9fa;
    color: #6c757d;
}

#quotationForm .dimension-group .form-control {
    text-align: center;
    min-width: 60px;
}

/* Keep dimension fields centered even in RTL mode */
[dir="rtl"] #quotationForm .dimension-group .form-control {
    text-align: center;
    direction: ltr; /* Keep numbers LTR for better readability */
}


/* Camera and Modal Interactions */
.camera-modal {
    z-index: 1060 !important; /* Higher than the default modal z-index */
}

/* Link delete button styling */
.delete-link-btn {
    padding: 0.25rem 0.5rem;
    line-height: 1.2;
    height: 30px;
    font-size: 0.875rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    width: auto;
    min-width: 60px;
}

/* RTL support for delete button */
[dir="rtl"] .delete-link-btn {
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* RTL support for form fields */
[dir="rtl"] .form-control,
[dir="rtl"] .form-select,
[dir="rtl"] .form-textarea {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .form-control::placeholder,
[dir="rtl"] .form-select::placeholder {
    text-align: right;
}

[dir="rtl"] input[type="text"],
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="number"],
[dir="rtl"] textarea,
[dir="rtl"] select {
    text-align: right;
    direction: rtl;
}

/* Keep quotation modal visible when camera is active */
.modal.camera-active {
    display: block !important;
    opacity: 1 !important;
    z-index: 1050 !important;
}

/* Add dimmed background for camera modal */
.camera-modal .modal-backdrop {
    opacity: 0.7;
    z-index: 1055 !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 25vh;
    display: flex;
    align-items: center;
}

.hero-image {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Product Cards */
.product-icon {
    transition: transform 0.3s ease;
}

.card:hover .product-icon {
    transform: scale(1.1);
}

.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
}

/* Form Styles */
.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
}

/* Modal Styles */
.modal-xl {
    max-width: 1200px;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* File Upload */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.file-upload-area.dragover {
    border-color: #667eea;
    background-color: #f0f2ff;
}

/* Image Preview */
.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #dee2e6;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 12px;
    cursor: pointer;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    text-align: center;
    padding: 2rem;
}

.spinner-border {
    color: #667eea;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 8px;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

/* Table Styles */
.table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: #f8f9ff;
}

/* Badge Styles */
.badge {
    font-size: 0.75rem;
    padding: 0.5em 0.75em;
}

/* Admin Dashboard */
.admin-sidebar {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    min-height: 100vh;
    color: white;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: white;
    background-color: rgba(255,255,255,0.1);
    border-radius: 8px;
}

/* Stats Cards */
.stats-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: 20vh;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .modal-xl {
        max-width: 95%;
        margin: 1rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    /* Modal title font size for mobile */
    .modal-title {
        font-size: 18px !important;
    }
    
    /* Badge size adjustment for mobile */
    .modal-title .badge {
        font-size: 14px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .modal,
    .admin-sidebar {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .bg-light {
        background-color: #343a40 !important;
        color: white;
    }
    
    .text-muted {
        color: #adb5bd !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Pulse animation for field highlighting */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* Standardized Font Sizes */
.font-xl {
    font-size: 20px !important;
}

.font-lg {
    font-size: 18px !important;
}

.font-md {
    font-size: 16px !important;
}

.font-sm {
    font-size: 14px !important;
}

.font-xs {
    font-size: 12px !important;
}

/* Apply standard font sizes to common elements */
h1, .h1 {
    font-size: 20px !important;
}

h2, .h2 {
    font-size: 18px !important;
}

h3, .h3 {
    font-size: 16px !important;
}

h4, .h4 {
    font-size: 14px !important;
}

h5, .h5, h6, .h6 {
    font-size: 12px !important;
}

/* Apply to form elements */
#quotationForm .form-control,
#quotationForm .form-select {
    font-size: 14px;
}
