@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&family=Aref+Ruqaa:wght@400;700&family=Reem+Kufi:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #5c1b77;
    /* Deep Purple */
    --secondary-color: #8e44ad;
    /* Lighter Purple */
    --accent-color: #f1c40f;
    /* Gold */
    --text-color: #2c3e50;
    --bg-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.95);
    --countdown-bg: #43314a;
    --glass-border: 1px solid rgba(255, 255, 255, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Almarai', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-image: url('https://www.transparenttextures.com/patterns/arabesque.png');
    /* Subtle pattern */
    color: var(--text-color);
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Header --- */
header {
    background: linear-gradient(to left, #4a1c57, #6a2c89);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 10;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--accent-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Main Content --- */
main {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.hero-section {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 1s ease-out;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 30px;
}

/* --- Countdown Timer --- */
.countdown-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 0 auto 50px;
    max-width: 800px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--countdown-bg);
    color: white;
    padding: 20px 10px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.time-unit:hover {
    transform: translateY(-5px);
}

.time-number {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent-color);
}

.time-label {
    font-size: 1rem;
    margin-top: 5px;
    opacity: 0.9;
}

/* --- Greetings Section --- */
.greetings-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-top: 50px;
}

.section-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.8rem;
    position: relative;
    display: inline-block;
    width: 100%;
}

.greetings-form {
    max-width: 600px;
    margin: 0 auto 40px;
    background: #f9f9f9;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #eee;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--primary-color);
}

input[type="text"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

input[type="text"]:focus,
select:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.2);
}

button.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

button.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(92, 27, 119, 0.3);
}

/* --- Greetings List --- */
.greetings-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-height: 500px;
    overflow-y: auto;
    padding: 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-color) #f0f0f0;
}

.greeting-card {
    background: white;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 12px;
    position: relative;
    transition: all 0.3s;
    border-right: 4px solid var(--secondary-color);
}

.greeting-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transform: translateX(-5px);
}

.greeting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.greeting-name {
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.flag-icon {
    width: 20px;
    border-radius: 2px;
}

.share-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #95a5a6;
    transition: color 0.3s;
}

.share-btn:hover {
    color: var(--secondary-color);
}

.greeting-message {
    color: #555;
    font-size: 0.95rem;
}

/* --- Footer --- */
footer {
    background: #2d252e;
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
    border-top: 5px solid var(--primary-color);
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .countdown-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .time-number {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .countdown-container {
        padding: 10px;
    }

    .time-number {
        font-size: 1.8rem;
    }

    .time-label {
        font-size: 0.9rem;
    }
}

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

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

.pulse {
    animation: pulse 2s infinite;
}

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

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Decoration */
.ramadan-lantern {
    position: absolute;
    top: 0;
    left: 5%;
    width: 60px;
    animation: swing 3s infinite ease-in-out alternate;
    z-index: 11;
}

.ramadan-lantern-2 {
    position: absolute;
    top: 0;
    right: 5%;
    width: 80px;
    animation: swing 4s infinite ease-in-out alternate;
    z-index: 11;
}

@keyframes swing {
    0% {
        transform: rotate(5deg);
    }

    100% {
        transform: rotate(-5deg);
    }
}

/* Stats Dashboard (New) */
.stats-dashboard {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin: 40px auto;
    /* Centered */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    /* Centered Items */
    gap: 40px;
    flex-wrap: wrap;
    max-width: 800px;
}

/* --- Future Dates Table --- */
.dates-table-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-top: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 500px;
}

.custom-table th,
.custom-table td {
    padding: 18px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.custom-table th {
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
}

.custom-table th:first-child {
    border-top-right-radius: 12px;
}

.custom-table th:last-child {
    border-top-left-radius: 12px;
}

.custom-table tr:last-child td:first-child {
    border-bottom-right-radius: 12px;
}

.custom-table tr:last-child td:last-child {
    border-bottom-left-radius: 12px;
}

.custom-table tr:nth-child(even) {
    background-color: #f8fbfd;
}

.custom-table tr:hover {
    background-color: #f1e7f5;
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.countdown-cell {
    font-weight: bold;
    color: var(--secondary-color);
    direction: ltr;
    /* To display numbers correctly if mixed */
}

/* --- Reaction System --- */
.rating-section {
    text-align: center;
    background: rgba(255, 255, 255, 0.7);
    padding: 20px;
    border-radius: 15px;
    margin: 20px auto;
    max-width: 100%;
    backdrop-filter: blur(10px);
}

.rating-section.condensed h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.reactions-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 10px;
}

.reaction-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reaction-btn .emoji {
    font-size: 2.5rem;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.reaction-btn .label {
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.reaction-btn:hover {
    transform: scale(1.1);
}

.reaction-btn:hover .emoji,
.reaction-btn.selected .emoji {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.2);
}

.reaction-btn:hover .label,
.reaction-btn.selected .label {
    opacity: 1;
    transform: translateY(0);
    color: var(--primary-color);
}

/* Specific Colors on Active */
.reaction-btn[data-value="5"]:hover .emoji,
.reaction-btn[data-value="5"].selected .emoji {
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
}

.reaction-btn[data-value="4"]:hover .emoji,
.reaction-btn[data-value="4"].selected .emoji {
    text-shadow: 0 0 20px rgba(0, 100, 255, 0.4);
}

.reaction-btn[data-value="1"]:hover .emoji,
.reaction-btn[data-value="1"].selected .emoji {
    text-shadow: 0 0 20px rgba(255, 100, 0, 0.4);
}

.reaction-count {
    font-size: 0.85rem;
    font-weight: bold;
    color: #666;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 10px;
    border-radius: 10px;
    margin-top: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.reaction-btn:hover .reaction-count {
    list-style: none;
    /* Hide default triangle if desired, or keep */
    background: #e9ecef;
    transition: 0.3s;
}

.faq-section summary:hover {
    background: #dee2e6;
}

.faq-section p {
    padding: 15px;
    margin: 0;
    background: white;
}

.divider {
    border: 0;
    height: 1px;
    background: #ddd;
    margin: 40px 0;
}

/* --- Rich Article Content --- */
.ramadan-article {
    line-height: 1.8;
    color: #444;
    font-size: 1.05rem;
}

.ramadan-article h2 {
    color: var(--primary-color);
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 40px;
    margin-bottom: 25px;
}

.ramadan-article h3 {
    color: var(--secondary-color);
    margin-top: 30px;
    margin-bottom: 15px;
}

.article-image {
    margin: 30px 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.article-image img,
.content-article img {
    max-width: 100%;
    width: 100%;
    /* Fill container */
    height: auto;
    aspect-ratio: 1 / 1;
    /* Force Square */
    object-fit: cover;
    /* Crop to fit, no distortion */
    max-height: 500px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 5px solid white;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: zoom-in;
}

.article-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.article-image figcaption {
    font-size: 0.9rem;
    color: #777;
    margin-top: 10px;
    font-style: italic;
    background: #f8f9fa;
    padding: 5px 15px;
    border-radius: 20px;
}

/* Article Table */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.article-table th {
    background: var(--primary-color);
    color: white;
    padding: 12px;
}

.article-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: right;
}

.article-table tr:nth-child(even) {
    background: #f9f9f9;
}

.article-table .highlight {
    font-weight: bold;
    color: #2c3e50;
}

/* Alert Box */
.alert-box {
    background: #e3f2fd;
    border-right: 5px solid #2196f3;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    color: #0d47a1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-box i {
    font-size: 1.5rem;
}

/* --- Lightbox (Pop-up) Styles --- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1);
}

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

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    background: none;
    border: none;
    transition: transform 0.2s;
}

.lightbox-close:hover {
    transform: scale(1.1) rotate(90deg);
    color: var(--accent-color);
}

/* --- Stats Dashboard --- */
.stats-dashboard {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px auto;
    max-width: 800px;
    flex-wrap: wrap;
}

.stat-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    flex: 1;
    min-width: 250px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

/* --- Interaction Animations --- */
.shake {
    animation: shake 0.82s cubic-bezier(.36, .07, .19, .97) both;
    transform: translate3d(0, 0, 0);
    border: 2px solid var(--primary-color) !important;
    background: rgba(255, 235, 59, 0.2);
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* --- Mobile Fixes --- */
@media (max-width: 768px) {
    .alert-box {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 15px;
    }

    .alert-box i {
        font-size: 2rem;
        margin-bottom: 5px;
    }
}
/* --- Social Sharing Buttons --- */
.share-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.share-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.share-btn.whatsapp {
    background: #25D366;
}

.share-btn.facebook {
    background: #1877F2;
}

.share-btn.twitter {
    background: #000000;
}

.share-btn.telegram {
    background: #0088cc;
}

.share-btn.copy {
    background: #6c757d;
}

.share-btn.copy.copied {
    background: #27ae60;
}

