/* Dark Theme with Red Accents for Public Website */
:root {
    --primary-color: #dc3545;
    --primary-hover: #c82333;
    --bg-dark: #0d0d0d;
    --bg-darker: #1a1a1a;
    --bg-card: #242424;
    --text-light: #e0e0e0;
    --text-muted: #999;
    --border-color: #333;
}

body {
    background-color: var(--bg-darker);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Vazir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
    max-width: 100vw;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

main {
    flex: 1;
}

/* Navbar Styling */
.navbar {
    background-color: var(--bg-dark) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    padding: 1rem 0;
    width: 100%;
    max-width: 100vw;
}

.navbar-dark {
    background-color: var(--bg-dark) !important;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--text-light) !important;
    transition: color 0.3s ease;
}

.navbar-brand:hover {
    color: var(--primary-color) !important;
}

.navbar-brand img {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-link {
    color: var(--text-light) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background-color: var(--primary-color);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.2);
    border-color: var(--primary-color);
}

.card-body {
    color: var(--text-light);
    padding: 1.5rem;
}

.card-title {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 1rem;
}

.card-text {
    color: var(--text-muted);
}

.card-img-top {
    height: 250px;
    object-fit: cover;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Text Colors */
.text-primary {
    color: var(--primary-color) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Background Colors */
.bg-dark {
    background-color: var(--bg-dark) !important;
}

.bg-darker {
    background-color: var(--bg-darker) !important;
}

/* Footer */
footer {
    margin-top: auto;
    background-color: var(--bg-dark) !important;
    border-top: 1px solid var(--border-color);
}

footer h5 {
    font-weight: 600;
    margin-bottom: 1rem;
}

footer .text-danger {
    color: var(--primary-color) !important;
}

/* Forms */
.form-control,
.form-select {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-card);
    border-color: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

textarea.form-control {
    min-height: 150px;
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.5rem;
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    color: #4caf50;
    border-left: 4px solid #4caf50;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
    border-left: 4px solid var(--primary-color);
}

.alert-info {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border-left: 4px solid #17a2b8;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border-left: 4px solid #ffc107;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    padding: 5rem 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.hero-section p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Section Titles */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 1rem 0;
}

.breadcrumb-item {
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text-light);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    margin-top: 2rem;
}

.page-link {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-light);
}

.page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .navbar-nav {
    //flex-direction: row;
}

[dir="rtl"] .nav-link.active::after {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

[dir="rtl"] .section-title::after {
    left: auto;
    right: 0;
}

/* Responsive Design */
@media (max-width: 991px) {
    .navbar-collapse {
        background-color: var(--bg-dark);
        padding: 1rem;
        margin-top: 1rem;
        border-radius: 8px;
        border: 1px solid var(--border-color);
    }

    .nav-link.active::after {
        display: none;
    }
    
    .navbar-nav {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-item {
        width: 100%;
        text-align: center;
        padding: 0.25rem 0;
    }
    
    .nav-link {
        padding: 0.75rem 1rem !important;
        display: block;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .card-img-top {
        height: 200px;
    }

    .btn-primary,
    .btn-outline-primary {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Make images responsive */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix product detail images */
    .main-image img {
        width: 100%;
        height: auto;
        max-height: 400px;
    }
    
    .thumbnail-gallery .col-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 3rem 0;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .navbar-brand img {
        max-height: 30px;
    }
    
    /* Stack buttons vertically on mobile */
    .d-flex.gap-3 {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .d-flex.gap-3 .btn {
        width: 100%;
    }
    
    /* Adjust padding for mobile */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Make stat cards stack properly */
    .stat-card {
        margin-bottom: 1rem;
    }
    
    /* Adjust breadcrumb */
    .breadcrumb {
        font-size: 0.875rem;
        flex-wrap: wrap;
    }
    
    .breadcrumb-item {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(220, 53, 69, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Contact Page Specific Styles */
.page-header {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    border-bottom: 1px solid var(--border-color);
}

.contact-section .card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.contact-section .form-control,
.contact-section .form-select {
    font-size: 1rem;
}

.contact-section .btn-danger {
    font-size: 1.1rem;
    padding: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.contact-section .invalid-feedback {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.contact-section .is-invalid {
    border-color: var(--primary-color);
}

.contact-section .is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Contact Information Icons */
.contact-section svg {
    transition: transform 0.3s ease;
}

.contact-section .text-center:hover svg {
    transform: scale(1.1);
}

/* Additional responsive fixes for contact page */
@media (max-width: 768px) {
    .contact-section .card {
        margin: 0 0.5rem;
    }
    
    .contact-section .card-body {
        padding: 2rem 1.5rem !important;
    }
    
    .contact-section .row.mt-5 .col-md-4 {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .contact-section .card-body {
        padding: 1.5rem 1rem !important;
    }
    
    .page-header .display-4 {
        font-size: 2rem;
    }
    
    .page-header .lead {
        font-size: 1rem;
    }
}

/* Fix for horizontal scroll on all pages */
body, html {
    overflow-x: hidden;
    max-width: 100%;
}

.container, .container-fluid {
    overflow-x: hidden;
    padding-top:5px;
    padding-bottom:5px;
}

/* Ensure all images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Fix for wide content */
* {
    box-sizing: border-box;
}

.row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    padding-top:5px;
    padding-bottom:5px;
}

.row > * {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Mobile menu improvements */
@media (max-width: 991px) {
    .navbar-collapse {
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .navbar-nav .nav-link {
        border-bottom: 1px solid var(--border-color);
    }
    
    .navbar-nav .nav-item:last-child .nav-link {
        border-bottom: none;
    }
}

/* Mobile language switcher styling */
@media (max-width: 991px) {
    #mobileLangDropdown {
        background-color: transparent;
        color: var(--text-light);
        transition: all 0.3s ease;
    }
    
    #mobileLangDropdown:hover {
        background-color: rgba(220, 53, 69, 0.1);
        color: var(--primary-color);
    }
    
    #mobileLangDropdown svg {
        filter: drop-shadow(0 0 2px rgba(220, 53, 69, 0.3));
    }
    
    /* Make mobile language dropdown independent and fixed */
    .mobile-lang-dropdown {
        position: fixed !important;
        top: 60px !important;
        right: 10px !important;
        left: auto !important;
        transform: none !important;
        z-index: 9999 !important;
        min-width: 150px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    }
    
    [dir="rtl"] .mobile-lang-dropdown {
        right: auto !important;
        left: 10px !important;
    }
}

/* Ensure mobile language dropdown is properly positioned */
.navbar .dropdown-menu {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

.navbar .dropdown-item {
    color: var(--text-light);
    transition: all 0.3s ease;
}

.navbar .dropdown-item:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--primary-color);
}

.navbar .dropdown-item.active {
    background-color: var(--primary-color);
    color: white;
}

/* Desktop language dropdown - make it independent like mobile */
@media (min-width: 992px) {
    .desktop-lang-dropdown {
        position: fixed !important;
        top: 60px !important;
        //right: 20px !important;
        left: auto !important;
        transform: none !important;
        z-index: 9999 !important;
        min-width: 180px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    }
    
    [dir="ltr"] .desktop-lang-dropdown {
        right: auto !important;
        //left: 20px !important;
    }
}
