/* Reset and General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #008080;
    --secondary-color: #00b3b3;
    --bg-dark: #10191a;
    --card-bg: #181f20;
    --text-color: #fff;
    --accent-color: #b2dfdf;
    --font-size-base: clamp(0.9rem, 2vw, 1rem);
    --padding-base: clamp(0.5rem, 2vw, 1rem);
    --gap-base: clamp(1rem, 2.5vw, 1.5rem);
    --container-width: min(90%, 1400px);
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .nav-container,
[dir="rtl"] .about-content,
[dir="rtl"] .contact-container,
[dir="rtl"] .footer-top {
    flex-direction: row-reverse;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    background-color: #000;
    color: var(--text-color);
    min-height: 100vh;
    font-size: var(--font-size-base);
}

/* Section Titles */
.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: var(--gap-base);
    color: var(--text-color);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(60px, 10vw, 80px);
    height: 4px;
    background-color: var(--primary-color);
}

/* Language Switcher */
.lang-switcher {
    position: fixed;
    top: clamp(10px, 2vw, 20px);
    right: clamp(10px, 2vw, 20px);
    z-index: 2000;
    transition: all 0.3s ease;
}

.lang-btn {
    background: rgba(0, 128, 128, 0.9);
    color: var(--text-color);
    border: none;
    padding: clamp(8px, 1.5vw, 10px) clamp(12px, 2vw, 15px);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: clamp(80px, 10vw, 90px);
    justify-content: center;
}

.lang-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.lang-btn i {
    font-size: clamp(1rem, 1.8vw, 1.1rem);
}

/* Containers */
.container, .dashboard-container {
    width: var(--container-width);
    margin: 0 auto;
    padding: var(--padding-base);
    display: flex;
    flex-direction: column;
    gap: var(--gap-base);
}

/* Loader Styles */
.loader {
    position: fixed;
    width: 100%;
    height: 100vh;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeOut 2.5s ease-out forwards;
    animation-delay: 2s;
}

.loader-text {
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--text-color);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    opacity: 0;
    animation: fadeInOut 2s ease-in-out;
}

/* Navigation Styles */
nav {
    background-color: rgba(0, 0, 0, 0.95);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    padding: var(--padding-base);
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.nav-container {
    width: var(--container-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding-right: 110px;
    margin-left: 24px;
}

.logo {
    color: var(--text-color);
    text-decoration: none;
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    font-weight: bold;
    transition: color 0.3s ease;
}

.logo:hover {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--gap-base);
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    color: #000;
    background: var(--primary-color);
    border-radius: 4px;
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    width: 30px;
    height: 14px;
    cursor: pointer;
    z-index: 3002;
    padding: 0;
    background: transparent;
    border: none;
    position: relative;
}

.menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
    position: absolute;
    left: 32px;
}

.menu-toggle span:nth-child(1) {
    top: 1px;
}

.menu-toggle span:nth-child(2) {
    top: 14px;
}

.menu-toggle span:nth-child(3) {
    top: 27px;
}

.menu-toggle.active span {
    background-color: var(--primary-color);
}

/* Hero Section */
.hero-slider {
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slide.active {
    opacity: 1;
}

.slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: min(90%, 800px);
    color: var(--text-color);
}

.slide-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.slide-content p {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    margin-bottom: 2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Mission Section */
.mission-section {
    padding: clamp(3rem, 5vw, 6rem) 0;
    background-color: rgba(255, 255, 255, 0.02);
}

.mission-content {
    width: min(90%, 800px);
    margin: 0 auto;
    text-align: center;
}

.mission-text {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    line-height: 1.8;
    color: var(--text-color);
    padding: var(--padding-base);
    border-left: 4px solid var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 10px 10px 0;
}

/* About Section */
.about-section {
    padding: clamp(3rem, 5vw, 6rem) 0;
    background-color: #000;
}

.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-items: center;
    gap: clamp(2rem, 3vw, 4rem);
    margin-top: 3rem;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

.about-text {
    text-align: left;
}

.about-highlight {
    font-size: clamp(1.5rem, 2.5vw, 1.8rem);
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.about-desc {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* Why Choose Us Section */
.why-choose-section {
    padding: clamp(2rem, 4vw, 4rem) 0;
}

.why-choose-intro {
    width: min(90%, 800px);
    margin: 0 auto 3rem;
    text-align: center;
}

.benefits-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--gap-base);
}

.benefit-card {
    background: rgba(255, 255, 255, 0.05);
    padding: var(--padding-base);
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.benefit-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.1);
}

.benefit-icon {
    font-size: clamp(2rem, 3vw, 2.5rem);
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* Contact Section */
.contact-section {
    background: #000;
    border-radius: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: var(--padding-base);
    width: min(100%, 900px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--gap-base);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: clamp(0.8rem, 1.5vw, 1.2rem);
}

.contact-form label {
    font-weight: 500;
    color: var(--accent-color);
    margin-bottom: 0.3rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: var(--padding-base);
    border-radius: 0.5rem;
    border: 1.5px solid #222;
    background: #232b2c;
    color: var(--text-color);
    font-size: var(--font-size-base);
    transition: border 0.2s, background 0.2s;
    outline: none;
    resize: vertical;
    min-height: clamp(40px, 10vw, 44px);
}

.contact-form input:focus,
.contact-form textarea:focus {
    border: 1.5px solid var(--primary-color);
    background: #1a2324;
}

.contact-form button {
    padding: var(--padding-base);
    background: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 0.5rem;
    font-size: clamp(1rem, 1.8vw, 1.13rem);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 128, 128, 0.10);
}

.contact-form button:hover {
    background: var(--secondary-color);
}

/* Login & Dashboard Cards */
.login-card, .dashboard-card, .stat-card, .chart-container, .recent-visits {
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: var(--padding-base);
    display: flex;
    flex-direction: column;
    gap: clamp(0.8rem, 1.5vw, 1.2rem);
}

/* Responsive Tables */
.visits-table, .dashboard-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-dark);
    border-radius: 0.5rem;
    overflow: hidden;
}

.visits-table th, .visits-table td, .dashboard-table th, .dashboard-table td {
    padding: var(--padding-base);
    text-align: left;
    border-bottom: 1px solid #2a3a3b;
}

.visits-table th, .dashboard-table th {
    color: var(--accent-color);
    font-weight: 500;
    background: var(--card-bg);
}

.visits-table tr:hover, .dashboard-table tr:hover {
    background: #1a2324;
}

/* Utility: Responsive Grid for Dashboard */
.stats-grid, .charts-grid {
    display: grid;
    gap: var(--gap-base);
    grid-template-columns: repeat(auto-fit, minmax(clamp(200px, 25vw, 220px), 1fr));
}

/* Buttons */
.btn, .logout-btn, .reset-btn, .contact-form button {
    padding: var(--padding-base);
    border-radius: 0.5rem;
    border: none;
    background: var(--primary-color);
    color: var(--text-color);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover, .logout-btn:hover, .reset-btn:hover, .contact-form button:hover {
    background: var(--secondary-color);
}

/* Touch-friendly */
input, button, textarea, select {
    font-size: var(--font-size-base);
    min-height: clamp(40px, 10vw, 44px);
}

/* Enhanced touch interactions */
.btn, .nav-link, .lang-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn:active, .nav-link:active, .lang-btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Remove focus outlines and click boxes on all devices */
*:focus {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-focus-ring-color: transparent !important;
    -moz-outline: none !important;
}

*:active {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.btn:focus, .nav-link:focus, .lang-btn:focus, 
button:focus, a:focus, input:focus, textarea:focus, select:focus {
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-focus-ring-color: transparent !important;
    -moz-outline: none !important;
}

/* Remove tap highlights on mobile */
button, a, input, textarea, select, [role="button"] {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Allow text selection in form fields */
input, textarea {
    -webkit-user-select: text !important;
    -khtml-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Better mobile form interactions */
@media (max-width: 768px) {
    .contact-form input,
    .contact-form textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px;
    }
    
    .btn {
        min-height: 48px;
        font-size: 1rem;
    }
    
    .nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Loading states for images */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img.loaded {
    opacity: 1;
}

/* Improved scroll behavior */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Hamburger Menu for Small Screens */
@media (max-width: 930px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(80%, 300px);
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right 0.3s ease;
        padding: var(--padding-base);
        gap: var(--gap-base);
        z-index: 2001;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-link {
        font-size: clamp(1rem, 2vw, 1.2rem);
        width: 100%;
        text-align: center;
        padding: var(--padding-base);
    }

    .nav-links > li:last-child {
        width: 100%;
        justify-content: center;
        margin: 1rem 0 0 0;
    }

    .lang-switcher {
        top: clamp(10px, 2vw, 15px);
        right: clamp(60px, 10vw, 70px);
    }

    .nav-container {
        padding-right: 0;
        margin-left: 0;
    }
}

@media (max-width: 930px) {
    body.drawer-open .nav-links { right: 0; }
    body.drawer-open .menu-toggle span { background-color: var(--primary-color); }
}

/* Footer Styles */
.footer-container {
    width: 100%;
    background: #111;
    color: #fff !important;
    padding: 0 0 0.5rem 0;
    margin-top: 2rem;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.12);
}
.footer-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 2rem 0.5rem 2rem;
    border-bottom: 1px solid #222;
    flex-wrap: wrap;
}
.footer-top p {
    margin: 0;
    font-size: 1rem;
    color: #fff !important;
}
.social-links {
    display: flex;
    gap: 1.2rem;
}
.social-link {
    color: #b2dfdf;
    font-size: 1.3rem;
    transition: color 0.2s;
    text-decoration: none;
    opacity: 0.8;
}
.social-link:hover {
    color: #00b3b3;
    opacity: 1;
}
.footer-bottom {
    padding: 1.2rem 2rem 0.5rem 2rem;
    text-align: center;
    font-size: 0.98rem;
    color: #fff !important;
    position: relative;
}
.admin-login-link {
    position: absolute;
    right: 24px;
    bottom: 10px;
    font-size: 0.95rem;
    color: #b2dfdf;
    text-decoration: none;
    opacity: 0.6;
    transition: color 0.2s, opacity 0.2s;
}
.admin-login-link:hover { color: #008080; opacity: 1; text-decoration: underline; }
@media (max-width: 700px) {
    .footer-top, .footer-bottom {
        flex-direction: column;
        align-items: center;
        padding: 1rem 0.5rem;
        text-align: center;
    }
    .footer-top {
        gap: 0.7rem;
    }
    .admin-login-link {
        position: static;
        display: block;
        margin: 0.7rem auto 0 auto;
    }
}

/* Language Toggle Button in Nav - always right on desktop, centered in drawer */
.nav-container .lang-toggle {
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
    order: 99;
    display: flex;
    justify-content: flex-end;
    direction: ltr !important;
}
@media (min-width: 931px) {
    [dir="rtl"] .nav-links > li.lang-toggle {
        margin-left: auto !important;
        margin-right: 0 !important;
        justify-content: flex-end;
        direction: ltr !important;
    }
}
@media (max-width: 930px) {
    .nav-links {
        flex-direction: column;
        align-items: center;
    }
    .nav-links > li.lang-toggle {
        position: static;
        width: 100%;
        justify-content: center;
        margin: 1rem 0 0 0 !important;
        transform: none;
    }
}

/* Contact Section - text color white */
.contact-section, .contact-section label, .contact-section h2, .contact-section h3, .contact-section p, .contact-section .info-item, .contact-section .contact-description {
    color: #fff !important;
}

/* Contact Section - wider and pure black on large screens */
@media (max-width: 900px) {
    .contact-section {
        width: min(98%, 700px);
    }
}
@media (max-width: 600px) {
    .contact-section {
        width: min(98%, 100vw);
    }
}

.cta-buttons .btn-primary {
    text-decoration: none !important;
}
.cta-buttons .btn-secondary {
    background: none !important;
    text-decoration: none !important;
    color: #fff !important;
    border: 3px solid var(--primary-color);
    font-weight: bold;
    box-shadow: 0 2px 12px rgba(0,179,179,0.18);
    transition: color 0.2s, border 0.2s, background 0.2s, box-shadow 0.2s;
}
.cta-buttons .btn-secondary:hover {
    color: #fff !important;
    background: var(--primary-color) !important;
    border-color: var(--primary-color);
    text-decoration: none !important;
    box-shadow: 0 4px 18px rgba(0,179,179,0.28);
}

@media (min-width: 931px) and (max-width: 1205px) {
    .logo {
        font-size: 1rem !important;
    }
    .nav-link {
        font-size: 0.85rem !important;
        padding: 0.2rem 0.35rem !important;
    }
}

/* Form Enhancements */
.field-error {
    color: #ffffff;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    min-height: 1.2rem;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.field-error.show {
    opacity: 1;
    transform: translateY(0);
}

.form-helpers {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 0.3rem;
    min-height: 1.2rem;
}

.char-counter {
    font-size: 0.8rem;
    color: var(--accent-color);
    opacity: 0.7;
}

.char-counter.warning {
    color: #ffa500;
}

.char-counter.error {
    color: #ffffff;
}

.form-status {
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-status--success {
    background: rgba(5, 150, 105, 0.1);
    border: 1px solid #059669;
    color: #10b981;
}

.form-status--error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid #dc2626;
    color: #ef4444;
}

.form-status--info {
    background: rgba(55, 65, 81, 0.1);
    border: 1px solid #374151;
    color: var(--accent-color);
}

.contact-form input:invalid:not(:focus):not(:placeholder-shown),
.contact-form textarea:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.contact-form input:valid:not(:focus):not(:placeholder-shown),
.contact-form textarea:valid:not(:focus):not(:placeholder-shown) {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.btn-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Toast notifications */
#toast-container {
	position: fixed;
	top: 20px;
	right: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	z-index: 9999;
}

.toast {
	min-width: 240px;
	max-width: 90vw;
	padding: 12px 16px;
	border-radius: 8px;
	color: #fff;
	background: rgba(17, 24, 39, 0.95);
	box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
	opacity: 0;
	transform: translateY(-10px);
	transition: opacity 0.25s ease, transform 0.25s ease;
	font-size: 14px;
	line-height: 1.4;
}

.toast.show {
	opacity: 1;
	transform: translateY(0);
}

.toast--success { background: #059669; }
.toast--error { background: #dc2626; }
.toast--warning { background: #d97706; }
.toast--info { background: #374151; }