:root {
    --primary: #0f4c81;
    --primary-dark: #0a3a62;
    --secondary: #00b4d8;
    --accent: #ff6b35;
    --success: #10b981;
    --text: #1e293b;
    --white: #ffffff;
    --radius: 20px;
    --shadow-sm: 0 5px 15px rgba(0, 0, 0, .08);
    --shadow: 0 10px 30px rgba(0, 0, 0, .10);
    --transition: .35s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    color: var(--text);
    background: #f8fafc;
    line-height: 1.8;
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
}

a {
    text-decoration: none;
}

ul {
    list-style: none;
}

.container {
    width: min(1200px, 92%);
    margin: auto;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    z-index: 9999;
    background: rgba(15, 76, 129, .94);
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, .15);
    transition: .3s;
}

.nav-container {
    max-width: 1300px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 5%;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d3d60b;
    font-size: clamp(1.2rem, 2vw, 1.7rem);
    font-weight: 800;
}

.logo img {
    width: auto;
    height: 52px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    color: #d3d60b;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: .3s;
}

.nav-links a:hover {
    color: var(--secondary);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ===== Hero ===== */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100svh;
    padding: 110px 20px 70px;
    color: white;
}

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: auto;
    animation: heroFade .8s ease;
}

@keyframes heroFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 15px;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: .95;
}

.typing-effect {
    display: inline-block;
    margin-bottom: 30px;
    color: #d3d60b;
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    border-left: 3px solid #eaee19;
    padding-left: 8px;
    animation: typing 8s steps(40, end) infinite, blink .8s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 36px;
    border-radius: 50px;
    background: var(--accent);
    color: white;
    transition: var(--transition);
    font-weight: 600;
}

.btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .2);
}

.section {
    padding: 80px 5%;
}

.section-title {
    text-align: center;
    color: #0b3b5c;
    font-size: clamp(2rem, 4vw, 2.6rem);
    margin-bottom: 45px;
    position: relative;
}

.section-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -15px;
    transform: translateX(-50%);
    width: 90px;
    height: 4px;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
}

/* ===== Tablet ===== */
@media (max-width: 992px) {
    .nav-container {
        gap: 15px;
    }
    .nav-links {
        gap: 18px;
    }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        padding: 8px 15px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .logo {
        font-size: 1rem;
        gap: 8px;
    }

    .logo img {
        height: 38px;
    }

    .nav-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px 12px;
        width: 100%;
        order: 3;
    }

    .nav-links a {
        font-size: 0.85rem;
        padding: 4px 0;
    }

    .hero {
        min-height: 85vh;
        min-height: 85svh;
        padding: 110px 15px 40px;
        align-items: flex-start;
        padding-top: 130px;
    }

    .hero-content {
        width: 100%;
        padding-top: 10px;
    }

    .hero h1 {
        font-size: clamp(1.6rem, 5vw, 2.2rem);
        margin-bottom: 10px;
    }

    .hero p {
        font-size: clamp(0.9rem, 2vw, 1rem);
        margin-bottom: 5px;
    }

    .typing-effect {
        font-size: clamp(1rem, 3.5vw, 1.2rem);
        margin-bottom: 15px;
        display: inline-block;
        white-space: nowrap;
        overflow: hidden;
        border-left: 3px solid #eaee19;
        padding-left: 8px;
        animation: typing 8s steps(40, end) infinite, blink .8s step-end infinite;
        max-width: 100%;
    }

    .btn {
        padding: 12px 30px;
        font-size: 0.95rem;
        max-width: 280px;
        margin: 0 auto;
    }

    .section {
        padding: 60px 20px;
    }

    .footer {
        text-align: center;
        padding: 50px 20px 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-section h3::after {
        margin: auto;
        margin-top: 8px;
    }

    .register-box {
        border-radius: 20px;
    }
}

/* ===== Very Small Mobile ===== */
@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .hero {
        min-height: 80vh;
        min-height: 80svh;
        padding: 120px 12px 30px;
    }

    .hero h1 {
        font-size: 1.4rem;
    }

    .hero p {
        font-size: 0.85rem;
    }

    .typing-effect {
        font-size: 0.95rem;
        margin-bottom: 12px;
        white-space: nowrap;
        overflow: hidden;
        border-left: 3px solid #eaee19;
        padding-left: 8px;
        animation: typing 8s steps(40, end) infinite, blink .8s step-end infinite;
        max-width: 90%;
    }

    .btn {
        padding: 10px 24px;
        font-size: 0.85rem;
        max-width: 220px;
    }

    .section {
        padding: 50px 15px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo img {
        height: 40px;
    }

    .card {
        padding: 25px 18px;
    }

    .card i {
        width: 68px;
        height: 68px;
        line-height: 68px;
        font-size: 2.2rem;
    }
}

/* ===== Fields ===== */
#fields {
    background: #f8fafc;
    padding: 80px 0;
}

.cards-grid {
    width: min(1200px, 92%);
    margin: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.cards-grid a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card {
    background: #fff;
    border-radius: 22px;
    padding: 40px 28px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .07);
    border: 1px solid #edf2f7;
    transition: .35s;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #f39c12, #ff6b35);
    transform: scaleX(0);
    transition: .35s;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .12);
    border-color: #ffb347;
}

.card:hover::before {
    transform: scaleX(1);
}

.card i {
    width: 85px;
    height: 85px;
    line-height: 85px;
    border-radius: 50%;
    font-size: 3rem;
    margin-bottom: 22px;
    transition: .35s;
}

.card:nth-child(1) i {
    color: #d0b500;
    background: #edf5ff;
}

.card:nth-child(2) i {
    color: #8b5cf6;
    background: #f3edff;
}

.card:nth-child(3) i {
    color: #10b981;
    background: #ecfff8;
}

.card:hover i {
    transform: rotate(6deg) scale(1.1);
}

.card h2,
.card h3 {
    font-size: 1.45rem;
    color: #0b3b5c;
    margin-bottom: 15px;
    transition: .3s;
}

.card:hover h2,
.card:hover h3 {
    color: #ff6b35;
}

.card p {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.8;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    opacity: 0;
    animation: fadeUp .7s ease forwards;
}

.card:nth-child(1) {
    animation-delay: .1s;
}
.card:nth-child(2) {
    animation-delay: .25s;
}
.card:nth-child(3) {
    animation-delay: .4s;
}

@media (max-width: 992px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }
    .card {
        padding: 30px 22px;
    }
    .card i {
        width: 75px;
        height: 75px;
        line-height: 75px;
        font-size: 2.5rem;
    }
}

/* ===== Info Table ===== */
.info-table {
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
}

.info-row {
    display: flex;
    border-bottom: 1px solid #eef2f7;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    flex: 1;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    padding: 18px 22px;
}

.info-value {
    flex: 2;
    padding: 18px 22px;
    background: #fff;
}

@media (max-width: 768px) {
    .info-row {
        flex-direction: column;
    }
    .info-label {
        text-align: center;
    }
    .btn-large {
        width: 100%;
    }
}

/* ===== Gallery ===== */
#gallery {
    background: #f1f5f9;
    padding: 80px 0;
}

.slideshow-container {
    position: relative;
    width: min(1200px, 95%);
    margin: auto;
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .12);
    aspect-ratio: 16/9;
}

.slides-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    direction: ltr;
    transition: transform .6s ease-in-out;
}

.slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .7s ease;
}

.slide:hover img {
    transform: scale(1.04);
}

.slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 55px;
    height: 55px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    cursor: pointer;
    font-size: 22px;
    transition: .3s;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.slide-btn:hover {
    background: var(--accent);
    transform: translateY(-50%) scale(1.08);
}

.prev-btn {
    left: 20px;
}
.next-btn {
    right: 20px;
}

.slide-dots {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 120;
}

.slide-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
    transition: .3s;
}

.slide-dot.active {
    background: #fff;
    transform: scale(1.35);
}

.slide-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 30px;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, .65), transparent);
}

.slide-caption h3 {
    font-size: clamp(1.2rem, 3vw, 2rem);
    margin-bottom: 8px;
}

.slide-caption p {
    font-size: clamp(.9rem, 2vw, 1.1rem);
}

@media (max-width: 992px) {
    .slideshow-container {
        width: 95%;
    }
    .slide-btn {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 768px) {
    #gallery {
        padding: 60px 0;
    }
    .slideshow-container {
        width: 100%;
        border-radius: 15px;
        aspect-ratio: 4/3;
    }
    .slide-btn {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }
    .prev-btn {
        left: 10px;
    }
    .next-btn {
        right: 10px;
    }
    .slide-caption {
        padding: 18px;
    }
    .slide-dots {
        bottom: 12px;
        gap: 8px;
    }
    .slide-dot {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .slideshow-container {
        aspect-ratio: 1/1;
    }
    .slide-caption {
        padding: 12px;
    }
    .slide-caption h3 {
        font-size: 1rem;
    }
    .slide-caption p {
        display: none;
    }
    .slide-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* ===== Footer ===== */
.footer {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 70px 5% 25px;
}

.footer-content {
    width: min(1200px, 95%);
    margin: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    margin-bottom: 18px;
    font-size: 1.3rem;
    position: relative;
}

.footer-section h3::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: var(--secondary);
    margin-top: 8px;
    border-radius: 20px;
}

.footer-section p {
    margin-bottom: 12px;
    opacity: .95;
    line-height: 1.9;
}

.footer-section a {
    color: #fff;
    transition: .3s;
}

.footer-section a:hover {
    color: #d3d60b;
}

.footer-section i {
    margin-left: 8px;
    color: var(--secondary);
}

.copyright {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .15);
    font-size: .95rem;
    opacity: .9;
}

@media (max-width: 992px) {
    .footer {
        padding: 60px 30px 25px;
    }
    .footer-content {
        gap: 30px;
    }
}

/* ===== History Section ===== */
.history-section {
    padding: 70px 5%;
    background: #f8f9fc;
}

.history-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 35px;
    align-items: start;
}

.history-text h3 {
    font-size: 32px;
    color: #17479e;
    margin-bottom: 25px;
}

.history-text p {
    text-align: justify;
    line-height: 2.2;
    color: #555;
    margin-bottom: 18px;
}

.history-info {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .08);
    padding: 25px;
    position: sticky;
    top: 90px;
}

.history-info h4 {
    color: #17479e;
    margin-bottom: 20px;
    text-align: center;
}

.info-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.info-item:last-child {
    border: none;
    margin-bottom: 0;
}

.info-item span {
    font-size: 28px;
}

.info-item strong {
    color: #222;
}

.info-item p {
    margin-top: 5px;
    color: #666;
    line-height: 1.8;
}

@media (max-width: 992px) {
    .history-content {
        grid-template-columns: 1fr;
    }
    .history-info {
        position: static;
    }
    .history-text h3 {
        font-size: 28px;
    }
}

/* ===== Utility Classes ===== */
.fade-in {
    animation: fadeIn .8s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scale-hover {
    transition: .3s;
}
.scale-hover:hover {
    transform: scale(1.03);
}

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 10px;
}
.mt-2 {
    margin-top: 20px;
}
.mt-3 {
    margin-top: 30px;
}
.mt-4 {
    margin-top: 40px;
}
.mb-1 {
    margin-bottom: 10px;
}
.mb-2 {
    margin-bottom: 20px;
}
.mb-3 {
    margin-bottom: 30px;
}
.mb-4 {
    margin-bottom: 40px;
}
.rounded {
    border-radius: var(--radius);
}
.shadow {
    box-shadow: var(--shadow);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #eef2f7;
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 30px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== Large Desktop ===== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    .cards-grid {
        max-width: 1320px;
    }
    .hero-content {
        max-width: 1000px;
    }
}

/* ===== Prevent Common Issues ===== */
iframe,
video,
canvas {
    max-width: 100%;
}
table {
    width: 100%;
    border-collapse: collapse;
}
input,
textarea,
select,
button {
    font-family: inherit;
}
button {
    cursor: pointer;
}