/* CSS Fixes for Help My Ride */

/* Ensure all elements have proper box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Reset and base styles */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background-color: #f8fafc;
    margin: 0;
    padding: 0;
}

/* Arabic font support - ULTRA STRONG - EXCLUDE Font Awesome icons */
html[lang="ar"] *:not(.fas):not(.far):not(.fab):not(.fa):not([class*="fa-"]),
html[dir="rtl"][lang="ar"] *:not(.fas):not(.far):not(.fab):not(.fa):not([class*="fa-"]),
[lang="ar"] *:not(.fas):not(.far):not(.fab):not(.fa):not([class*="fa-"]),
[dir="rtl"][lang="ar"] *:not(.fas):not(.far):not(.fab):not(.fa):not([class*="fa-"]),
[lang="ar"]:not(.fas):not(.far):not(.fab):not(.fa):not([class*="fa-"]),
[dir="rtl"]:not(.fas):not(.far):not(.fab):not(.fa):not([class*="fa-"]),
.arabic-text:not(.fas):not(.far):not(.fab):not(.fa):not([class*="fa-"]),
*[data-lang="ar"]:not(.fas):not(.far):not(.fab):not(.fa):not([class*="fa-"]) {
    font-family: 'Cairo', 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    direction: rtl !important;
    text-align: right !important;
}

/* Fix Font Awesome icons for Arabic - restore proper display */
html[lang="ar"] .fas,
html[lang="ar"] .far,
html[lang="ar"] .fab,
html[lang="ar"] .fa,
html[lang="ar"] i[class*="fa-"],
html[dir="rtl"][lang="ar"] .fas,
html[dir="rtl"][lang="ar"] .far,
html[dir="rtl"][lang="ar"] .fab,
html[dir="rtl"][lang="ar"] .fa,
html[dir="rtl"][lang="ar"] i[class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro" !important;
    direction: ltr !important;
    text-align: center !important;
    display: inline-block !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
}

/* Ensure Arabic text uses Cairo font - ULTRA STRONG */
html[lang="ar"],
html[dir="rtl"][lang="ar"],
body[lang="ar"],
html[lang="ar"] body {
    font-family: 'Cairo', 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    direction: rtl !important;
}

/* Force Cairo on all Arabic elements - EXCLUDE Font Awesome icons */
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6,
html[lang="ar"] p,
html[lang="ar"] span:not(.fas):not(.far):not(.fab):not(.fa):not([class*="fa-"]),
html[lang="ar"] div,
html[lang="ar"] a,
html[lang="ar"] button,
html[lang="ar"] input,
html[lang="ar"] textarea,
html[lang="ar"] select,
html[lang="ar"] .nav-item,
html[lang="ar"] .nav-item span:not(.fas):not(.far):not(.fab):not(.fa):not([class*="fa-"]),
html[lang="ar"] .admin-title,
html[lang="ar"] .sidebar-header,
html[lang="ar"] .user-menu {
    font-family: 'Cairo', 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Hebrew font support */
[lang="he"],
*[data-lang="he"] {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    direction: rtl;
    text-align: right;
}

/* RTL text direction for all RTL elements */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

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

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

/* Ensure containers are visible */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

.logo i {
    font-size: 1.75rem;
}

/* Main content */
.main-content {
    flex: 1;
    padding: 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Hero section */
.hero-section {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 1rem;
    margin-bottom: 3rem;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Cards */
.card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

/* Services grid */
.services-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.service-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

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

.service-card i {
    font-size: 2.5rem;
    color: #2563eb;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.service-card p {
    color: #64748b;
    margin-bottom: 1rem;
}

/* Issue types */
.issue-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.issue-type-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.issue-type-card:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
}

.issue-type-card.selected {
    border-color: #2563eb;
    background: #eff6ff;
}

.issue-type-card i {
    font-size: 2rem;
    color: #2563eb;
    margin-bottom: 0.75rem;
}

.issue-type-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

/* Map container */
.map-container {
    height: 400px;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    margin: 1.5rem 0;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #1e293b;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: white;
    color: #1e293b;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

/* Language selector */
.language-selector {
    position: relative;
}

.language-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: white;
    color: #1e293b;
    font-size: 0.875rem;
}

/* User menu */
.user-menu {
    position: relative;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-button:hover {
    background: #e2e8f0;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    display: none;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #1e293b;
    text-decoration: none;
    transition: all 0.2s ease;
}

.user-dropdown a:hover {
    background: #f8fafc;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px 0 rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    justify-content: flex-end;
}

/* Messages */
.message-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 3000;
}

.message {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

.message.success {
    background: #10b981;
    color: white;
}

.message.error {
    background: #ef4444;
    color: white;
}

.message.warning {
    background: #f59e0b;
    color: white;
}

.message.info {
    background: #2563eb;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Utility classes */
.hidden {
    display: none !important;
}

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

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

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

/* Ensure proper spacing */
section {
    margin: 2rem 0;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem 0;
    color: #1e293b;
}

p {
    margin: 0 0 1rem 0;
    color: #64748b;
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Ensure proper button styling */
button {
    font-family: inherit;
}

/* Ensure proper input styling */
input, select, textarea {
    font-family: inherit;
}

/* Ensure proper link styling */
a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}
