@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/iran-sans/webfonts/css/iran-sans.css');

body {
    font-family: 'Inter', sans-serif;
}

/* Persian font - IRANSans for RTL mode */
.rtl {
    font-family: 'IRANSans', 'Iran Sans', 'Tahoma', 'Arial', sans-serif;
}

/* Bold titles in Persian mode */
.rtl h1,
.rtl h2,
.rtl h3,
.rtl h4,
.rtl h5,
.rtl h6 {
    font-weight: bold !important;
}

/* Bold specific title classes in Persian mode */
.rtl .font-bold,
.rtl .font-semibold,
.rtl .font-medium {
    font-weight: bold !important;
}

/* RTL spacing for dropdown arrows */
.rtl .fas.fa-chevron-down {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

/* Smart banner height that adapts to device */
.banner-section {
    height: 70vh;
    min-height: 400px;
    max-height: 600px;
    position: relative;
    overflow: hidden;
    margin-left: 8%;
    margin-right: 8%;
    padding: 0;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .banner-section {
        height: 60vh;
        min-height: 350px;
        max-height: 500px;
        margin-left: 5%;
        margin-right: 5%;
    }
}

/* Very small mobile devices */
@media (max-width: 480px) {
    .banner-section {
        height: 50vh;
        min-height: 300px;
        max-height: 400px;
        margin-left: 3%;
        margin-right: 3%;
    }
    
    .banner-slide {
        left: -3%;
        right: -3%;
    }
}

/* Landscape mobile devices */
@media (max-height: 500px) and (orientation: landscape) {
    .banner-section {
        height: 80vh;
        min-height: 250px;
    }
}

.banner-slide {
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
    z-index: 0;
    position: absolute;
    top: 0;
    bottom: 0;
    left: -8%;
    right: -8%;
    width: auto;
}

.banner-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

/* Banner Navigation Buttons */
.banner-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.banner-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.banner-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.banner-nav-prev {
    left: 2rem;
}

.banner-nav-next {
    right: 2rem;
}

.banner-nav-btn i {
    font-size: 1.25rem;
}

/* Banner Indicators */
.banner-indicators-container {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    backdrop-filter: blur(5px);
}

.banner-indicator {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: white;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.banner-indicator.active {
    opacity: 1;
    transform: scale(1.2);
}

.banner-pause-icon {
    color: white;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    opacity: 0.8;
}

/* Responsive adjustments for banner navigation */
@media (max-width: 768px) {
    .banner-section {
        margin-left: 5%;
        margin-right: 5%;
    }
    
    .banner-slide {
        left: -5%;
        right: -5%;
    }
    
    .banner-nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .banner-nav-btn i {
        font-size: 1rem;
    }
    
    .banner-nav-prev {
        left: 1rem;
    }
    
    .banner-nav-next {
        right: 1rem;
    }
}

.project-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.nav-link {
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #3B82F6;
}

.social-icon {
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-2px);
    color: #3B82F6;
}

.lang-btn {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.lang-btn.active {
    background-color: #3B82F6;
    color: white;
}

.rtl {
    direction: rtl;
}

/* RTL spacing adjustments for contact section icons */
.rtl .w-12.h-12.mr-4 {
    margin-right: 0;
    margin-left: 1rem;
}

/* General RTL spacing for icon containers */
.rtl .mr-4 {
    margin-right: 0;
    margin-left: 1rem;
}

/* RTL spacing for social media icons - fix for Persian mode */
.rtl .flex.space-x-3 > * + * {
    margin-left: 0;
    margin-right: 0.75rem;
}

.rtl .flex.space-x-4 > * + * {
    margin-left: 0;
    margin-right: 1rem;
}

/* Specific fix for header social icons in RTL */
.rtl .social-icon {
    margin-left: 0 !important;
}

.rtl .social-icon:not(:first-child) {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* Specific fix for footer social icons in RTL */
.rtl footer .flex > a {
    margin-left: 0 !important;
}

.rtl footer .flex > a:not(:first-child) {
    margin-right: 0.75rem !important;
    margin-left: 0 !important;
}

/* RTL spacing between language toggle and social icons */
.rtl .flex.items-center.space-x-4 > div:last-child {
    margin-left: 0 !important;
    margin-right: 1.5rem !important;
}

/* Logo styling - transparent background */
.logo-container {
    background: transparent;
    border: none;
}

.logo-container img {
    filter: brightness(1.1) contrast(1.1);
    transition: filter 0.3s ease;
}

.logo-container:hover img {
    filter: brightness(1.2) contrast(1.2);
}

/* Favicon styling for better transparency support */
link[rel="icon"] {
    background: transparent;
}

/* Ensure favicon displays properly in different browsers */
@media (prefers-color-scheme: dark) {
    link[rel="icon"] {
        filter: brightness(1.1);
    }
}

.hidden-lang {
    display: none;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Features Showcase Section - Modern Card Design */
.showcase-card {
    min-height: 450px;
    position: relative;
}

.showcase-box {
    position: relative;
    z-index: 10;
    width: 100%;
}

.showcase-image {
    position: absolute;
    z-index: 5;
}

/* Mobile responsive adjustments */
@media (max-width: 1023px) {
    .showcase-image {
        right: 0 !important;
        left: 6 !important;
        right: 6 !important;
    }
    
    .rtl .showcase-image {
        left: 0 !important;
        right: 6 !important;
        left: 6 !important;
    }
}

/* RTL Support for Showcase Section */
.rtl .showcase-image {
    left: auto;
    right: 6;
}

@media (min-width: 1024px) {
    .rtl .showcase-image {
        left: -80px;
        right: 6;
    }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.dropdown-menu {
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(-10px);
    opacity: 0;
}

.dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
}

/* Services section layout */
.services-grid {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.service-item {
    flex: 1 1 0;
}

.service-item.small {
    flex: 1 1 0;
}

.service-item.large {
    flex: 2 1 0; /* make center card visibly larger */
}

.service-media {
    display: block;
    overflow: hidden;
    border-radius: 1rem;
    aspect-ratio: 4 / 3;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b1428;
}

.service-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.service-media:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
}

.service-media:hover img {
    transform: scale(1.05);
}

/* Icon inside service card */
.service-icon {
    width: 64px;
    height: 64px;
    opacity: 0.9;
    transition: transform 0.35s ease, filter 0.35s ease, opacity 0.35s ease;
}

.service-icon.emphasized {
    width: 88px;
    height: 88px;
}

.service-media:hover .service-icon {
    transform: scale(1.12);
    filter: saturate(1.15) brightness(1.15);
    opacity: 1;
}

.service-title {
    margin: 0.75rem 0 0;
    text-align: center;
    color: #0f172a; /* slate-900 */
    font-weight: 700;
    font-size: 1.25rem;
}

/* Gradient backgrounds for service cards */
.grad-ai {
    background: linear-gradient(135deg, #4f46e5 0%, #22d3ee 100%);
}

.grad-fab {
    background: linear-gradient(135deg, #0ea5e9 0%, #22c55e 100%);
}

.grad-research {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

@media (max-width: 1024px) {
    .service-item.large { flex: 1.3 1 0; }
}

@media (max-width: 768px) {
    .services-grid {
        flex-direction: column;
    }
    .service-item,
    .service-item.large,
    .service-item.small {
        flex: 1 1 auto;
    }
    .service-media { aspect-ratio: 16 / 9; }
}

/* Optional placeholder fallback */
.service-placeholder {
    background: #b2aca4; /* neutral gray-beige similar to sample */
    color: #0b1428;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Breadcrumb Navigation */
.breadcrumb {
    padding: 1rem 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.breadcrumb-container {
    max-width: 80rem; /* 7xl equivalent */
    margin: 0 auto;
    padding: 0 1rem;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-link {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: #3b82f6;
}

.breadcrumb-separator {
    color: #9ca3af;
    margin: 0 0.25rem;
}

.breadcrumb-current {
    color: #111827;
    font-weight: 500;
}

/* RTL support for breadcrumbs */
.rtl .breadcrumb-list {
    direction: rtl;
}

/* Topic Navigation (for News page) */
.topic-navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 2rem;
}

.topic-nav-item {
    display: flex;
    align-items: center;
    color: #70275d;
    text-decoration: none;
    font-size: 1.125rem; /* Increased from 0.95rem to 1.125rem (18px) */
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
}

.topic-nav-item:hover {
    color: #5a1f4b;
}

.topic-nav-item::before {
    content: '>';
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

.rtl .topic-nav-item::before {
    content: '<';
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.topic-nav-item:first-child::before {
    display: none;
}

.topic-nav-item.active {
    color: #5a1f4b;
    font-weight: 600;
}

/* Project card transition for filtering */
.project-card {
    transition: opacity 0.3s ease, transform 0.3s ease, display 0.3s ease;
}

/* Responsive topic navigation */
@media (max-width: 768px) {
    .topic-navigation {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .topic-nav-item {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .topic-nav-item::before {
        display: none;
    }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Scroll offset for anchor links (to account for sticky header) */
/* Using JavaScript for more precise control, but keeping minimal CSS offset as fallback */
section[id],
div[id] {
    scroll-margin-top: 0; /* JavaScript handles the offset precisely */
}

/* Go to Top Button */
.go-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
}

.go-to-top.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.go-to-top:hover {
    background-color: #2563eb;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.go-to-top:active {
    transform: translateY(0);
}

.go-to-top i {
    font-size: 1.25rem;
}

/* RTL support for go to top button */
.rtl .go-to-top {
    right: auto;
    left: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .go-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
    }
    
    .rtl .go-to-top {
        right: auto;
        left: 1.5rem;
    }
}
