/* ==========================================
   RAD Engineers - Modern CSS Stylesheet
   ========================================== */

/* CSS Variables for Easy Customization */
:root {
    --primary-color: #16167a;      /* RAD Blue - rgb(22,22,122) */
    --secondary-color: #2ecc71;    /* Green Accent */
    --accent-color: #3498db;       /* Light Blue */
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --white: #ffffff;
    --light-bg: #f8f9fa;
    --border-color: #e0e0e0;

    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-brand: Georgia, 'Times New Roman', serif;
    --transition: all 0.3s ease;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
}

/* ==========================================
   Reset & Base Styles
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* ==========================================
   Typography
   ========================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* ==========================================
   Layout
   ========================================== */
.container {
    width: 90%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 5rem 0;
}

.section-alt {
    background-color: var(--light-bg);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-light);
}

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

/* ==========================================
   Navigation
   ========================================== */
.navbar {
    background-color: rgba(255, 255, 255, 0.5);
    box-shadow: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-md);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: var(--font-brand);
    padding: 0.25rem;
    border-radius: 4px;
}

.logo-image {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.logo-name {
    height: 30px;
    width: auto;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-menu a:hover,
.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 3px 0;
    transition: var(--transition);
}

/* Language Toggle Button */
.lang-toggle {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 0.5rem;
}

.lang-toggle:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

/* ==========================================
   Hero Section
   ========================================== */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    background: var(--primary-color);
    overflow: hidden;
}

/* Hero Slideshow */
.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    background-size: cover;
    background-position: center;
    transition: opacity 1.5s ease-in-out;
    animation: slideZoom 12s ease-in-out infinite;
}

.hero-slide.active {
    opacity: 1;
}

@keyframes slideZoom {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
    }
}

/* Fallback gradient when no images */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    z-index: 0;
}

.hero.has-slideshow::before {
    display: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 2rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white);
    animation: fadeInUp 0.8s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: var(--white);
    animation: fadeInUp 0.8s ease 0.2s both;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    text-align: center;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-small {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

.btn-large {
    padding: 1.125rem 2.5rem;
    font-size: 1.1rem;
}

/* ==========================================
   Services Grid
   ========================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: center;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    color: var(--secondary-color);
}

.service-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* ==========================================
   Projects Grid
   ========================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.project-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.project-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(26, 58, 82, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.project-category {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ==========================================
   Features Grid
   ========================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

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

.feature-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--secondary-color);
    opacity: 0.2;
    margin-bottom: 1rem;
}

.feature-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* ==========================================
   Call to Action
   ========================================== */
.cta {
    text-align: center;
    padding: 5rem 0;
}

.cta-content h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-section p,
.footer-section ul li {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

/* ==========================================
   Animations
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease;
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 768px) {
    h1 { font-size: 2.25rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    .container {
        padding: 0 1rem;
    }

    .section {
        padding: 3rem 0;
    }

    /* Mobile Navigation */
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
    }

    .nav-menu a::after {
        display: none;
    }

    /* Hero Section */
    .hero {
        height: 100vh;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    /* Grids */
    .services-grid,
    .projects-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.875rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* ==========================================
   Utility Classes
   ========================================== */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

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

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

/* ==========================================
   RTL Support (Farsi/Persian)
   ========================================== */
body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl .nav-menu {
    flex-direction: row-reverse;
}

body.rtl .nav-wrapper {
    flex-direction: row-reverse;
}

body.rtl .logo a {
    flex-direction: row-reverse;
}

body.rtl .nav-menu a::after {
    left: auto;
    right: 0;
}

body.rtl .lang-toggle {
    margin-left: 0;
    margin-right: 0.5rem;
}

body.rtl .services-grid,
body.rtl .features-grid,
body.rtl .footer-content {
    direction: rtl;
}

body.rtl .service-card,
body.rtl .feature-item {
    text-align: right;
}

body.rtl ul {
    margin-left: 0;
    margin-right: 2rem;
    padding-left: 0;
    padding-right: 0;
}

body.rtl .footer-section {
    text-align: right;
}

body.rtl .hero-content {
    text-align: center;
}

body.rtl .section-header {
    text-align: center;
}

body.rtl .cta-content {
    text-align: center;
}

body.rtl .form-group {
    text-align: right;
}

body.rtl .form-control {
    text-align: right;
}

@media (max-width: 768px) {
    body.rtl .nav-menu {
        flex-direction: column;
        left: auto;
        right: -100%;
    }

    body.rtl .nav-menu.active {
        left: auto;
        right: 0;
    }
}

/* ==========================================
   RTL Support (Farsi/Persian)
   ========================================== */
body.rtl {
    direction: rtl;
    text-align: right;
    font-family: 'Segoe UI', Tahoma, 'B Nazanin', 'Vazirmatn', Geneva, Verdana, sans-serif;
}

body.rtl .nav-wrapper {
    flex-direction: row-reverse;
}

body.rtl .nav-menu {
    flex-direction: row-reverse;
}

body.rtl .logo a {
    flex-direction: row-reverse;
}

body.rtl .nav-menu a::after {
    left: auto;
    right: 0;
}

body.rtl .services-grid,
body.rtl .features-grid,
body.rtl .footer-content {
    direction: rtl;
}

body.rtl .service-card,
body.rtl .feature-item {
    text-align: right;
}

body.rtl ul {
    margin-left: 0;
    margin-right: 2rem;
}

body.rtl .hero-content {
    text-align: center;
}

body.rtl .section-header {
    text-align: center;
}

body.rtl .cta-content {
    text-align: center;
}

body.rtl .footer-section {
    text-align: right;
}

body.rtl .form-group {
    text-align: right;
}

body.rtl .lang-toggle {
    margin-left: 0;
    margin-right: 0.5rem;
}

@media (max-width: 768px) {
    body.rtl .nav-menu {
        flex-direction: column;
        left: auto;
        right: -100%;
    }

    body.rtl .nav-menu.active {
        left: auto;
        right: 0;
    }
}
