/**
 * SolarGostaran - Solar Energy Website
 * Custom RTL Styles for Persian UI
 * Bootstrap 5.x RTL + Solar Energy Theme
 */

/* === Persian Font (Vazir or IRANSans) === */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    /* Solar Energy Brand Colors */
    --primary-color: #0973ba;      /* Amber/Gold (sun) */
    --primary-dark: #014f83;
    --primary-light: #3b96d3;
    
    --secondary-color: #0ea5e9;    /* Sky blue */
    --secondary-dark: #0284c7;
    
    --success-color: #10b981;      /* Green (eco) */
    --dark-color: #1f2937;
    --light-bg: #f9fafb;
    --white: #ffffff;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    direction: rtl;
    text-align: right;
    background-color: var(--white);
    color: var(--dark-color);
    line-height: 1.8;
    font-size: 16px;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* === Buttons === */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark), #093fb4);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* === Header & Navigation === */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
}

.navbar-nav .nav-link {
    color: var(--dark-color);
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

/* === Hero Section === */
.hero-section {
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(30, 41, 59, 0.8)), url('../images/hero-solar-panels.jpg') center/cover no-repeat;
    color: var(--white);
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="rgba(245,158,11,0.1)"/></svg>');
    background-size: 300px;
    opacity: 0.2;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, var(--white), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: #cbd5e1;
    line-height: 1.8;
}

/* === Section Styles === */
.section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* === Cards === */
.card {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    height: 100%;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.card-img-top {
    height: 250px;
    object-fit: cover;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
}

.card-text {
    color: #6b7280;
    line-height: 1.6;
}

/* === Project Card === */
.project-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}

.project-card .overlay {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    color: var(--white);
}

.project-card:hover .overlay {
    opacity: 1;
}

/* === Gallery Grid === */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    cursor: pointer;
    aspect-ratio: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 60%, transparent 100%);
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

.gallery-item-content {
    color: var(--white);
}

.gallery-item-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.gallery-item-caption {
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0;
    color: rgba(255,255,255,0.9);
}

/* === Gallery Modal === */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--dark-color);
    transition: all 0.3s ease;
    z-index: 10;
}

.gallery-nav-btn:hover {
    background: var(--white);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav-prev {
    right: 1rem;
}

.gallery-nav-next {
    left: 1rem;
}

#galleryModal .modal-content {
    background-color: rgba(0,0,0,0.95);
}

#galleryModal .modal-body {
    max-height: 80vh;
    overflow: hidden;
}

#galleryModal img {
    max-height: 80vh;
    width: auto;
    margin: 0 auto;
    display: block;
}

.gallery-item {
    cursor: pointer;
}

/* === Footer === */
.site-footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #cbd5e1;
    padding: 3rem 0 1rem;
}

.footer-title {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #cbd5e1;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: var(--white);
    margin-left: 0.5rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
}

/* === Form Styles === */
.form-control,
.form-select {
    border-radius: 0.5rem;
    border: 2px solid #e5e7eb;
    padding: 0.75rem 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(245,158,11,0.25);
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
}

/* === Utilities === */
.bg-light-custom {
    background-color: var(--light-bg);
}

.text-primary-custom {
    color: var(--primary-color);
}

.badge-custom {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
}

/* === News Card Styles === */
.news-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.news-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.1);
}

.news-card-date {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--primary-color), #fb923c);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(245,158,11,0.3);
    display: flex;
    flex-direction: column;
    min-width: 60px;
}

.news-card-date .day {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
}

.news-card-date .month {
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.news-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.news-card-title a {
    color: var(--dark-bg);
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-card-title a:hover {
    color: var(--primary-color);
}

.news-card-text {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    flex: 1;
    line-height: 1.7;
}

.news-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #94a3b8;
}

.news-author,
.news-views {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: gap 0.3s ease;
}

.news-read-more:hover {
    gap: 0.75rem;
    color: #d97706;
}

.news-read-more i {
    transition: transform 0.3s ease;
}

.news-read-more:hover i {
    transform: translateX(-4px);
}
