@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;700&display=swap');

/* Custom Font for Nastaliq text */
@font-face {
    font-family: 'IranNastaliq';
    src: url('https://github.com/emenmousavi/tamannah/blob/main/fonts/IranNastaliq.ttf?raw=true') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary-color: #009688; /* Teal */
    --secondary-color: rgba(230, 248, 248, 0.8); /* Semi-transparent light teal/grey */
    --text-color: #333;
    --accent-color: #4DB6AC; /* Lighter teal accent */
    --link-color: var(--text-color);
    --link-hover-color: var(--primary-color);
    --header-bg-color: rgba(255, 255, 255, 0.85);
    --footer-bg-color: rgba(51, 51, 51, 0.85);
    --footer-text-color: #eee;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease-in-out;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    color: var(--text-color);
    line-height: 1.7;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
    background-color: #333; /* Fallback color */
    background-image: url('https://github.com/emenmousavi/tamannah/blob/main/images/1280px-Beautiful_view_of_Tabriz_in_Iran.jpg?raw=true');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    user-select: none;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3); /* Dark overlay */
    backdrop-filter: blur(3px); /* Subtle blur effect */
    z-index: -1;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 30px;
}

header {
    background-color: var(--header-bg-color);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-family: 'IranNastaliq', serif; /* Apply the custom font */
    font-size: 2.5rem;
    color: var(--primary-color);
    text-decoration: none;
    line-height: 1; /* Adjust line height for better alignment */
}

/* Hamburger Menu Button */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    margin-right: 20px;
    width: 30px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 3px 0;
    border-radius: 2px;
    transition: 0.3s;
}

/* Hamburger active toggle animations */
.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Desktop Navigation */
nav {
    display: block;
    position: relative;
}

nav ul {
    list-style: none;
    display: flex;
}

nav li {
    margin-right: 20px;
}

nav a {
    text-decoration: none;
    color: var(--link-color);
    font-size: 1rem;
    font-weight: 700;
    position: relative;
    padding: 0.5rem 0;
    white-space: nowrap;
}

nav a::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease-in-out;
}

nav a:hover {
    color: var(--link-hover-color);
}

nav a:hover::before {
    width: 100%;
}

/* Mobile Navigation Menu */
.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--header-bg-color);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1100;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-nav li:last-child {
    border-bottom: none;
}

.mobile-nav a {
    display: block;
    padding: 15px 30px;
    text-decoration: none;
    color: var(--link-color);
    font-size: 1rem;
    font-weight: 700;
    transition: background-color 0.3s ease;
}

.mobile-nav a:hover {
    background-color: rgba(77, 182, 172, 0.1);
    color: var(--primary-color);
}

main {
    padding-top: 80px;
    background-color: var(--secondary-color);
    padding-bottom: 40px;
}

.hero {
    text-align: center;
    padding: 120px 0;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease-out 0.3s forwards;
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.hero h2 {
    font-size: 1.4rem;
    color: var(--text-color);
    font-weight: 300;
}

.section {
    padding: 80px 0;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease-out 0.4s forwards;
}

.section h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 10px;
    display: inline-block;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background-color: var(--accent-color);
}

.poem-book-container {
    margin-bottom: 50px;
}

.poem-book-container h3 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.poem-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.poem-list-container {
    width: 33%;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.poem-list-container h4 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    font-size: 1.3rem;
}

.poem-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.poem-list-item {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    cursor: pointer;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.poem-list-item:last-child {
    border-bottom: none;
}

.poem-list-item:hover,
.poem-list-item.active {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* Full-page overlay for poems */
#full-page-poem-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    padding: 20px;
}

#full-page-poem-overlay.active {
    opacity: 1;
    visibility: visible;
}

.full-page-poem-content {
    background-color: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 900px;
    min-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

#full-page-poem-overlay.active .full-page-poem-content {
    transform: scale(1);
}

#full-page-poem-overlay h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

#full-page-poem-overlay p {
    font-size: 1.2rem;
    line-height: 2.5;
    white-space: pre-line;
    text-align: right;
}

#close-poem-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s, transform 0.2s;
}

#close-poem-btn:hover {
    background-color: var(--accent-color);
    transform: scale(1.1);
}

footer {
    background-color: var(--footer-bg-color);
    backdrop-filter: blur(5px);
    color: var(--footer-text-color);
    padding: 40px 0;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease-out 0.5s forwards;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    margin-bottom: 20px;
}

.footer-nav li {
    margin: 0 15px;
}

.footer-nav a {
    text-decoration: none;
    color: var(--footer-text-color);
    font-size: 0.9rem;
    font-weight: 700;
}

.footer-nav a:hover {
    color: var(--primary-color);
}

.social-links {
    margin-bottom: 20px;
}

.social-links a {
    color: var(--footer-text-color);
    font-size: 1.3rem;
    margin: 0 10px;
    text-decoration: none;
    opacity: 0.8;
}

.social-links a:hover {
    opacity: 1;
    transform: scale(1.1);
}

.social-links a[title="تلگرام"]:hover {
    color: #0088cc;
}

.social-links a[title="اینستاگرام"]:hover {
    color: #C13584;
}

.social-links a[title="ایمیل"]:hover {
    color: #4CAF50;
}

footer p {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design Overrides */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    .header-content {
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem;
    }
    /* Show hamburger menu */
    .hamburger {
        display: flex;
    }

    /* Hide desktop nav */
    nav {
        display: none;
    }

    /* Mobile navigation menu */
    .mobile-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--header-bg-color);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1100;
    }

    .mobile-nav.active {
        display: block;
    }

    .mobile-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-nav li {
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .mobile-nav li:last-child {
        border-bottom: none;
    }

    .mobile-nav a {
        display: block;
        padding: 15px 30px;
        text-decoration: none;
        color: var(--link-color);
        font-size: 1rem;
        font-weight: 700;
        transition: background-color 0.3s ease;
    }

    .mobile-nav a:hover {
        background-color: rgba(77, 182, 172, 0.1);
        color: var(--primary-color);
    }

    /* Other responsive adjustments */
    main {
        padding-top: 140px;
    }

    .hero {
        padding: 60px 0 80px 0;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero h2 {
        font-size: 1rem;
        line-height: 1.4;
        padding: 0 10px;
    }

    .section {
        padding: 50px 0;
    }

    .section h2 {
        font-size: 1.6rem;
    }

    .poem-container {
        flex-direction: column;
    }

    .poem-list-container {
        width: 100%;
        margin-bottom: 20px;
    }

    .poem-list-item {
        font-size: 1.2rem;
    }

    .footer-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .footer-nav li {
        margin: 5px 8px;
    }

    .footer-nav a {
        font-size: 0.85rem;
    }

    .social-links a {
        margin: 0 8px;
        font-size: 1.1rem;
    }
    .full-page-poem-content {
        min-width: 0 !important;
        width: 95vw !important;
        max-width: 95vw !important;
        padding: 20px !important;
        box-sizing: border-box;
        border-radius: 8px;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
    #close-poem-btn {
        left: auto !important;
        right: 10px !important;
        top: 10px !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 1.3rem !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .logo a {
        font-size: 1.8rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero h2 {
        font-size: 0.9rem;
    }

    .recitation-section {
        padding: 15px 10px;
    }

    .recitation-section h3 {
        font-size: 1.2rem;
    }

    .vocalist-menu {
        padding: 12px;
    }

    .vocalist-menu li {
        padding: 10px 6px;
        font-size: 0.85rem;
    }
}
