/* Restaurant Menu System - Common Styles */

/* Arabic Typography and RTL Support */
.rtl-support {
    direction: rtl;
    text-align: right;
}

/* Arabic Font Stack */
[dir="rtl"] body,
[dir="rtl"] .navbar,
[dir="rtl"] .card,
[dir="rtl"] .btn,
[dir="rtl"] .form-control,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
    font-family: 'Segoe UI', 'Tahoma', 'Noto Sans Arabic', 'Arabic UI Text', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

/* Enhanced Arabic Headings */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3 {
    font-weight: 600;
    letter-spacing: 0.02em;
}

[dir="rtl"] .display-1,
[dir="rtl"] .display-2,
[dir="rtl"] .display-3,
[dir="rtl"] .display-4 {
    font-weight: 700;
    line-height: 1.4;
}

/* Arabic Button Styling */
[dir="rtl"] .btn {
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 0.5rem 1.5rem;
}

[dir="rtl"] .btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* Arabic Form Elements */
[dir="rtl"] .form-control {
    text-align: right;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

[dir="rtl"] .form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Arabic Card Styling */
[dir="rtl"] .card {
    text-align: right;
}

[dir="rtl"] .card-title {
    font-weight: 600;
}

/* Arabic Navbar Enhancements */
[dir="rtl"] .navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 0.02em;
}

[dir="rtl"] .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    color: #0d6efd;
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-switcher a {
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.language-switcher a:hover {
    background-color: #e9ecef;
}

/* RTL Navigation Layouts */
[dir="rtl"] .language-switcher {
    flex-direction: row-reverse;
}

[dir="rtl"] .navbar-nav {
    flex-direction: row;
}

[dir="rtl"] .navbar-collapse {
    text-align: right;
}

[dir="rtl"] .dropdown-menu {
    text-align: right;
    right: 0;
    left: auto;
}

[dir="rtl"] .dropdown-item {
    text-align: right;
}

/* RTL Bootstrap Utilities Override */
[dir="rtl"] .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

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

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

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

/* Form Styles */
.form-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.required-field::after {
    content: " *";
    color: #dc3545;
}

.form-group {
    margin-bottom: 1.5rem;
}

.language-section {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.success-message {
    color: #198754;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Enhanced form validation styles */
.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' fill='%23198754' viewBox='0 0 8 8'%3e%3cpath d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* File upload styles */
.file-upload-container {
    position: relative;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.file-upload-container:hover {
    border-color: #0d6efd;
    background-color: #f8f9fa;
}

.file-upload-container.drag-over {
    border-color: #0d6efd;
    background-color: #e7f3ff;
}

.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-preview {
    margin-top: 1rem;
    text-align: center;
}

.file-upload-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.remove-file-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
}

.remove-file-btn:hover {
    background: rgba(220, 53, 69, 1);
}

/* Button styles */
.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
}

.btn-primary:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    transform: none;
    box-shadow: none;
}

/* Footer */
.footer {
    background-color: #343a40;
    color: white;
    padding: 2rem 0;
    text-align: center;
}

/* Card styles */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Alert styles */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d1edff;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-info {
    background-color: #cce8ff;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .form-container {
        margin: 1rem;
        padding: 1rem;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .language-section {
        padding: 0.75rem;
    }

    .file-upload-container {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .form-container {
        margin: 0.5rem;
        padding: 1rem;
    }

    .language-switcher {
        flex-direction: column;
        gap: 0.25rem;
    }

    .navbar-nav {
        text-align: center;
    }
}

/* Utility classes */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cursor-pointer {
    cursor: pointer;
}

.border-radius-8 {
    border-radius: 8px;
}

.shadow-sm {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shadow-md {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Profile and image styles */
.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.profile-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
}

.restaurant-image {
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

/* Menu item styles */
.menu-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.menu-item:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.1);
}

.menu-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.price-tag {
    font-size: 1.1rem;
    font-weight: bold;
    color: #28a745;
}

/* Status badges */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

/* Common styles for the restaurant menu system */

/* Base typography for Arabic and English */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Arabic typography */
[lang="ar"],
[dir="rtl"] {
    font-family: 'Noto Sans Arabic', 'Arial', sans-serif;
}

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

/* RTL Input Group Fixes */
[dir="rtl"] .input-group>.form-control:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

[dir="rtl"] .input-group>.form-control:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

[dir="rtl"] .input-group>.input-group-text:not(:last-child) {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

[dir="rtl"] .input-group>.input-group-text:not(:first-child) {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* RTL Button Icon Spacing */
[dir="rtl"] .btn .bi {
    margin-right: 0;
}

[dir="ltr"] .btn .bi {
    margin-right: 0.5rem;
    margin-left: 0;
}

/* RTL Form Layout */
[dir="rtl"] .form-label {
    text-align: right;
}

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

[dir="rtl"] .invalid-feedback {
    text-align: right;
}

/* RTL Navigation Improvements */
[dir="rtl"] .navbar-nav .nav-link {
    padding-left: 1rem;
    padding-right: 0.5rem;
}

[dir="ltr"] .navbar-nav .nav-link {
    padding-right: 1rem;
    padding-left: 0.5rem;
}

/* Mobile RTL Improvements */
@media (max-width: 768px) {
    [dir="rtl"] .input-group {
        flex-direction: row;
    }

    [dir="rtl"] .input-group-text {
        min-width: 45px;
        justify-content: center;
    }

    /* Better spacing for mobile Arabic text */
    [dir="rtl"] .card-body {
        padding: 1.25rem;
    }

    [dir="rtl"] .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
}

/* Text Direction Utilities */
.text-ltr {
    direction: ltr;
    text-align: left;
}

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

/* Numbers and codes should always be LTR */
.phone-input,
.code-input,
.number-input {
    direction: ltr !important;
    text-align: left !important;
}

[dir="rtl"] .phone-input,
[dir="rtl"] .code-input,
[dir="rtl"] .number-input {
    text-align: left !important;
}

/* Improved focus states for RTL */
[dir="rtl"] .form-control:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Better spacing for icons in RTL */
[dir="rtl"] .alert .bi {
    margin-left: 0.5rem;
    margin-right: 0;
}

[dir="ltr"] .alert .bi {
    margin-right: 0.5rem;
    margin-left: 0;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Custom scrollbar for RTL */
[dir="rtl"] ::-webkit-scrollbar {
    width: 8px;
}

[dir="rtl"] ::-webkit-scrollbar-track {
    background: #f1f1f1;
}

[dir="rtl"] ::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

[dir="rtl"] ::-webkit-scrollbar-thumb:hover {
    background: #555;
}