/* 
   Project: Caliphate Anthems Landing Page
   Theme: Modern Islamic Professional
   Author: AI Assistant
*/

:root {
    /* Color Palette - Pastel Modern with Contrast */
    --bg-primary: #f8f9fa;
    --bg-secondary: #e9ecef;

    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-light: #ffffff;

    --accent-gold: #c5a059;
    --accent-dark: #1a1a1a;

    /* Card Colors (Pastel Variants) */
    --color-orange-bg: #fff3e0;
    --color-orange-fg: #e65100;

    --color-red-bg: #ffebee;
    --color-red-fg: #c62828;

    --color-green-bg: #e8f5e9;
    --color-green-fg: #2e7d32;

    --color-blue-bg: #e1f5fe;
    --color-blue-fg: #0277bd;

    --color-darkblue-bg: #e8eaf6;
    --color-darkblue-fg: #283593;

    --color-purple-bg: #f3e5f5;
    --color-purple-fg: #6a1b9a;

    /* Spacing & Sizes */
    --circle-diameter: 600px;
    --card-size: 140px;
    --center-size: 180px;
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Kufi Arabic', 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background Pattern */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(#c5a059 0.5px, transparent 0.5px),
        radial-gradient(#c5a059 0.5px, var(--bg-primary) 0.5px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    opacity: 0.05;
    z-index: -1;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

/* Header Styles */
.main-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.main-title {
    font-family: 'Amiri', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--accent-dark);
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.main-title::after {
    content: '';
    display: block;
    width: 60%;
    height: 3px;
    background: var(--accent-gold);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    font-weight: 300;
}

/* Main Circular Layout */
.content-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    /* Take remaining space */
    min-height: 0;
    /* Allow shrinking if needed */
}

.circular-layout {
    position: relative;
    width: var(--circle-diameter);
    height: var(--circle-diameter);
    display: flex;
    justify-content: center;
    align-items: center;
    /* Scale down if screen is too short but wide enough */
    max-height: 80vh;
    max-width: 80vh;
}

/* Center Emblem */
.center-emblem {
    width: var(--center-size);
    height: var(--center-size);
    background: var(--accent-dark);
    border-radius: 50%;
    position: absolute;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 4px solid var(--accent-gold);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.emblem-inner {
    text-align: center;
    color: var(--accent-gold);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.logo-text {
    display: flex;
    flex-direction: column;
    font-family: 'Amiri', serif;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.logo-text .ar {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.logo-text .en {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 5px;
    font-family: 'Segoe UI', sans-serif;
}

/* Pulse Animation for Center */
.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--accent-gold);
    opacity: 0;
    animation: pulse 3s infinite;
    pointer-events: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Menu Cards */
.menu-card {
    position: absolute;
    width: var(--card-size);
    height: var(--card-size);
    border-radius: 50%;
    /* Circular cards */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    text-decoration: none;
    padding: 1rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    z-index: 5;

    /* Variable-based positioning to prevent jitter */
    transform: translate(var(--tx), var(--ty));
}

.menu-card:hover {
    transform: translate(var(--tx), var(--ty)) scale(1.15);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    z-index: 20;
}

/* Card Content Styling */
.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.card-title {
    font-family: 'Noto Kufi Arabic', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: inherit;
    margin: 0;
}

.card-desc {
    font-size: 0.75rem;
    opacity: 0.8;
    display: none;
}

/* Card Color Themes */
.card-orange {
    background-color: var(--color-orange-bg);
    color: var(--color-orange-fg);
    border: 2px solid rgba(230, 81, 0, 0.1);
}

.card-red {
    background-color: var(--color-red-bg);
    color: var(--color-red-fg);
    border: 2px solid rgba(198, 40, 40, 0.1);
}

.card-green {
    background-color: var(--color-green-bg);
    color: var(--color-green-fg);
    border: 2px solid rgba(46, 125, 50, 0.1);
}

.card-blue {
    background-color: var(--color-blue-bg);
    color: var(--color-blue-fg);
    border: 2px solid rgba(2, 119, 189, 0.1);
}

.card-darkblue {
    background-color: var(--color-darkblue-bg);
    color: var(--color-darkblue-fg);
    border: 2px solid rgba(40, 53, 147, 0.1);
}

.card-purple {
    background-color: var(--color-purple-bg);
    color: var(--color-purple-fg);
    border: 2px solid rgba(106, 27, 154, 0.1);
}

/* Positioning (Desktop Radial) using CSS Variables */
.pos-1 {
    --tx: 199px;
    --ty: -115px;
}

.pos-2 {
    --tx: 230px;
    --ty: 0px;
}

.pos-3 {
    --tx: 199px;
    --ty: 115px;
}

.pos-4 {
    --tx: -199px;
    --ty: 115px;
}

.pos-5 {
    --tx: -230px;
    --ty: 0px;
}

.pos-6 {
    --tx: -199px;
    --ty: -115px;
}



/* Footer */
.main-footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    width: 100%;
    margin-top: auto;
}

.main-footer p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.copyright {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Animations */
.fade-in-down {
    animation: fadeInDown 0.8s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.4s;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ------------------------------------------------------------------
   RESPONSIVE DESIGN (Mobile First / Adaptive)
   ------------------------------------------------------------------ */
@media (max-width: 992px) {
    :root {
        --circle-diameter: auto;
    }

    .content-wrapper {
        min-height: auto;
        padding: 2rem 0;
    }

    .circular-layout {
        width: 100%;
        height: auto;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        /* 2 Columns Grid */
        gap: 1.5rem;
        padding-top: 80px;
        /* Space for center emblem which moves up or stays? Let's move emblem to top */
    }

    /* Transform Layout for Mobile/Tablet */
    .center-emblem {
        position: relative;
        /* Change from absolute */
        grid-column: 1 / -1;
        /* Span full width */
        margin: 0 auto 2rem;
        /* Center horizontally */
        transform: none;
        width: 140px;
        height: 140px;
    }

    .logo-text .ar {
        font-size: 2rem;
    }

    .menu-card {
        position: relative;
        /* Reset absolute positioning */
        transform: none !important;
        /* Remove translation */
        width: 100%;
        height: auto;
        min-height: 120px;
        border-radius: 1rem;
        /* Rounded rect instead of circle */
        flex-direction: row;
        /* Horizontal layout for content */
        justify-content: flex-start;
        padding: 1.5rem;
        gap: 1rem;
        text-align: right;
        /* Align text for RTL */
    }

    .menu-card:hover {
        transform: translateY(-5px) !important;
        /* Simple lift on hover */
    }

    .card-content {
        align-items: flex-start;
        /* Align start for RTL (Right side) */
        width: 100%;
    }

    .icon {
        margin-bottom: 0;
        font-size: 2.5rem;
    }

    .card-title {
        font-size: 1.25rem;
    }

    .card-desc {
        display: block;
        /* Always show description on mobile cards */
        font-size: 0.9rem;
    }

    /* Specific overrides for flex direction inside card to match RTL visual flow */
    /* Since dir="rtl", flex-start is Right. That's correct. */
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
}

.modal-content {
    background-color: white;
    padding: 2.5rem;
    border-radius: 1.5rem;
    width: 90%;
    max-width: 500px;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    border: 4px solid var(--accent-gold);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s, transform 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--bg-secondary);
}

.modal-close:hover {
    color: var(--color-red-fg);
    transform: rotate(90deg);
    background-color: var(--color-red-bg);
}

.modal-title {
    font-family: 'Amiri', serif;
    font-size: 2.2rem;
    color: var(--accent-dark);
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.modal-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-gold);
    border-radius: 2px;
}

.modal-menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    text-decoration: none;
    font-family: 'Noto Kufi Arabic', sans-serif;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.modal-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.modal-item span:first-child {
    z-index: 1;
}

.modal-item .icon {
    font-size: 1.5rem;
    margin: 0;
    /* Reset global icon margin */
}

/* Specific colors for the 3 items */
.item-waqia {
    background-color: var(--color-blue-bg);
    color: var(--color-blue-fg);
    border: 2px solid rgba(2, 119, 189, 0.1);
}

.item-waqia:hover {
    background-color: #b3e5fc;
    border-color: var(--color-blue-fg);
}

.item-poems {
    background-color: var(--color-green-bg);
    color: var(--color-green-fg);
    border: 2px solid rgba(46, 125, 50, 0.1);
}

.item-poems:hover {
    background-color: #c8e6c9;
    border-color: var(--color-green-fg);
}

.item-feda {
    background-color: var(--color-orange-bg);
    color: var(--color-orange-fg);
    border: 2px solid rgba(230, 81, 0, 0.1);
}

.item-feda:hover {
    background-color: #ffe0b2;
    border-color: var(--color-orange-fg);
}

/* Specific colors for the Arabic items - Using variations of Red/Brown as requested/implied */
.item-ara-general {
    background-color: #fbe9e7;
    color: #bf360c;
    border: 2px solid rgba(191, 54, 12, 0.1);
}

.item-ara-general:hover {
    background-color: #ffccbc;
    border-color: #bf360c;
}

.item-ara-women {
    background-color: #fce4ec;
    color: #880e4f;
    border: 2px solid rgba(136, 14, 79, 0.1);
}

.item-ara-women:hover {
    background-color: #f8bbd0;
    border-color: #880e4f;
}

.item-ara-poems {
    background-color: #efebe9;
    color: #4e342e;
    border: 2px solid rgba(78, 52, 46, 0.1);
}

.item-ara-poems:hover {
    background-color: #d7ccc8;
    border-color: #4e342e;
}

.item-ara-thoura {
    background-color: #ffebee;
    color: #b71c1c;
    border: 2px solid rgba(183, 28, 28, 0.1);
}

.item-ara-thoura:hover {
    background-color: #ffcdd2;
    border-color: #b71c1c;
}

/* Specific colors for Feda items */
.item-feda-disks {
    background-color: #f1f8e9;
    color: #33691e;
    border: 2px solid rgba(51, 105, 30, 0.1);
}

.item-feda-disks:hover {
    background-color: #dcedc8;
    border-color: #33691e;
}

.item-feda-thoura {
    background-color: #e0f2f1;
    color: #004d40;
    border: 2px solid rgba(0, 77, 64, 0.1);
}

.item-feda-thoura:hover {
    background-color: #b2dfdb;
    border-color: #004d40;
}

/* Close button icon fix */
.modal-close::before {
    content: '×';
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 24px;
    line-height: 1;
}

@media (max-width: 576px) {
    .circular-layout {
        grid-template-columns: 1fr;
        /* 1 Column for small mobile */
        gap: 1rem;
    }

    .main-title {
        font-size: 1.75rem;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }

    .modal-title {
        font-size: 1.8rem;
    }

    .modal-item {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
}