@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;700&display=swap');

:root {
    --bg-color: #f9fafc;
    --text-color: #333;
    --header-bg: #fff;
    --accent-color: #00b9b9;
    --accent-dark: #008080;
    --card-bg: #fff;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --footer-bg-start: #111;
    --footer-bg-end: #222;
    --footer-text: #aaa;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #ddd;
    --header-bg: #1e1e1e;
    --accent-color: #00dada;
    --accent-dark: #00b9b9;
    --card-bg: #1e1e1e;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --footer-bg-start: #000;
    --footer-bg-end: #111;
    --footer-text: #ccc;
}

body {
    margin: 0;
    font-family: "Vazirmatn", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    direction: rtl;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    font-size: 16px;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

/* انیمیشن پس‌زمینه */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, rgba(0, 185, 185, 0.05), transparent);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --- تولبار --- */
header {
    background: var(--header-bg);
    box-shadow: 0 2px 6px var(--shadow-color);
    padding: 5px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 55px;
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

header:hover {
    box-shadow: 0 4px 12px rgba(0, 185, 185, 0.1);
}

header .logo {
    display: flex;
    align-items: center;
}

header .logo img {
    width: 130px;
    height: 55px;
    object-fit: contain;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav a {
    margin: 0 12px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 400;
    font-size: 1rem;
    transition: color 0.3s ease, background-color 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

nav a:hover {
    color: var(--accent-color);
    background-color: rgba(0, 185, 185, 0.05);
}

nav a.active {
    color: var(--accent-color);
    background-color: rgba(0, 185, 185, 0.1);
    font-weight: 700;
}

.theme-switch {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.theme-switch input {
    display: none;
}

.theme-switch-label {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 28px;
    background-color: #ccc;
    border-radius: 28px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    overflow: hidden;
}

.theme-switch-label::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.theme-switch-label .sun-icon,
.theme-switch-label .moon-icon {
    display: none;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-switch-label .sun-icon {
    content: '\f185';
    left: 8px;
    color: #ffd700;
    opacity: 1;
}

.theme-switch-label .moon-icon {
    content: '\f186';
    right: 8px;
    color: #292929;
    opacity: 0;
}

.theme-switch input:checked+.theme-switch-label {
    background-color: var(--accent-color);
}

.theme-switch input:checked+.theme-switch-label::before {
    transform: translateX(28px);
}

.theme-switch input:checked+.theme-switch-label .sun-icon {
    opacity: 0;
    transform: translateY(-50%) translateX(-10px);
}

.theme-switch input:checked+.theme-switch-label .moon-icon {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.theme-switch input:not(:checked)+.theme-switch-label .sun-icon {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.theme-switch input:not(:checked)+.theme-switch-label .moon-icon {
    opacity: 0;
    transform: translateY(-50%) translateX(10px);
}

.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
    width: 35px;
    height: 35px;
    position: relative;
    transition: background-color 0.3s ease;
}

.nav-toggle-label img {
    width: 30px;
    height: 30px;
    padding: 8px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@media screen and (max-width: 768px) {
    header {
        justify-content: space-between;
        padding: 10px 20px;
        align-items: center;
    }

    .nav-toggle-label {
        display: flex;
        align-items: center;
        justify-content: center;
        order: -1;
    }

    .logo {
        margin-right: 10px;
        margin-left: 0;
    }

    .theme-switch {
        margin-right: auto;
        margin-left: 0;
    }

    nav {
        display: none;
        position: absolute;
        top: 55px;
        right: 0;
        width: 100%;
        background: var(--header-bg);
        box-shadow: 0 2px 6px var(--shadow-color);
        padding: 20px 0;
        opacity: 0;
        transform: translateY(-20px);
        transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-toggle:checked~nav {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }

    nav a {
        display: block;
        margin: 10px 0;
        padding: 10px 40px;
        text-align: right;
        border-right: 4px solid transparent;
        font-size: 1rem;
        transition: border-color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
    }

    nav a:hover,
    nav a.active {
        border-right: 4px solid var(--accent-color);
        background-color: rgba(0, 185, 185, 0.05);
        transform: translateX(-5px);
    }
}

@media screen and (min-width: 769px) {
    .nav-toggle-label {
        display: none;
    }
}

/* --- بخش ارتباط با ما --- */
.contact-section {
    padding: 60px 20px;
    max-width: 1200px;
    margin: auto;
    text-align: center;
    position: relative;
}

.contact-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top center, rgba(0, 185, 185, 0.05), transparent);
    z-index: -1;
}

.contact-section h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--text-color);
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-rotate 5s ease infinite;
}

@keyframes gradient-rotate {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.contact-section p {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto 40px;
    font-weight: 300;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: auto;
}

.contact-card {
    background: linear-gradient(135deg, var(--card-bg), rgba(0, 185, 185, 0.02));
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 8px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    text-align: center;
    border: 1px solid rgba(0, 185, 185, 0.1);
    position: relative;
    overflow: hidden;
}

.contact-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0, 185, 185, 0.15);
}

.contact-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 185, 185, 0.1) 0%, transparent 70%);
    transition: transform 0.5s ease;
    opacity: 0;
}

.contact-card:hover::before {
    transform: scale(1.2);
    opacity: 1;
}

.contact-card i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 10px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.contact-card:hover i {
    transform: scale(1.2);
    color: var(--accent-dark);
}

.contact-card h3 {
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 1.3rem;
    font-weight: 400;
}

.contact-card p,
.contact-card a {
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 300;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-card a:hover {
    color: var(--accent-color);
}

/* --- فوتر --- */
footer {
    background: linear-gradient(180deg, var(--footer-bg-start), var(--footer-bg-end));
    color: var(--footer-text);
    padding: 40px 20px;
    text-align: center;
    font-size: 1rem;
    font-weight: 300;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top center, rgba(0, 185, 185, 0.05), transparent);
    z-index: 0;
}

.footer-content {
    max-width: 1200px;
    margin: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-section h4 {
    color: #fff;
    margin-bottom: 15px;
    font-weight: 400;
    font-size: 1rem;
    position: relative;
}

.footer-section h4::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background: var(--accent-color);
    margin-top: 5px;
}

.footer-section a {
    display: block;
    color: var(--footer-text);
    text-decoration: none;
    margin-bottom: 8px;
    font-size: 0.875rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.footer-section a:hover {
    color: var(--accent-color);
    transform: scale(1.06);
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.social-icons a:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 185, 185, 0.3);
}

.social-icons img {
    width: 24px;
    height: 24px;
}

.footer-bottom {
    margin-top: 20px;
    border-top: 1px solid #333;
    padding-top: 20px;
    position: relative;
    z-index: 1;
}

@media screen and (max-width: 768px) {
    .contact-section h1 {
        font-size: 2rem;
    }

    .contact-section p {
        font-size: 1rem;
    }

    .contact-card h3 {
        font-size: 1.2rem;
    }

    .contact-card p,
    .contact-card a {
        font-size: 0.9375rem;
    }

    .social-icons {
        flex-wrap: nowrap;
    }

    footer {
        font-size: 0.9375rem;
    }
}

/* رنگ اصلی فیروزه‌ای برای اکسنت‌ها */
a {
    color: var(--accent-color);
}

a:hover {
    color: var(--accent-dark);
}

/* Dark mode adjustments */
[data-theme="dark"] .contact-section p,
[data-theme="dark"] .contact-card p,
[data-theme="dark"] .contact-card a {
    color: #bbb;
}

[data-theme="dark"] .contact-section h1 {
    color: #eee;
}

/* Ensure consistent font scaling in mobile desktop mode */
@media screen and (min-width: 769px) {
    .contact-section h1 {
        font-size: 2.5rem !important;
    }

    .contact-card p,
    .contact-card a,
    footer {
        font-size: 1rem !important;
    }
}