@font-face {
    font-family: "KFGQPC Uthmanic Script HAFS";
    src: url("hafs.otf") format("opentype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

:root {
    --primary-green: #0d6b4b;
    --dark-green: #064e35;
    --gold: #c9a227;
    --light-gold: #e8d48b;
    --cream: #f0f5f0;
    --dark-text: #1a2e1a;
    --arabic-font-size: 18px;
    --translation-font-size: 12px;
}

body {
    font-family:
        "Noto Sans Arabic",
        -apple-system,
        sans-serif;
    background: linear-gradient(
        135deg,
        var(--dark-green) 0%,
        var(--primary-green) 50%,
        #1a5c3e 100%
    );
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    overflow: hidden;
    color: var(--dark-text);
    position: relative;
}

/* Islamic geometric pattern overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M30 0L60 30L30 60L0 30L30 0zm0 10L10 30l20 20 20-20L30 10z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.container {
    width: 100%;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.slides-wrapper {
    display: flex;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 85px 00px 40px 00px;
    text-align: center;
}

.slide-content {
    background: linear-gradient(
        180deg,
        var(--cream) 0%,
        #e8f0e8 100%
    );
    border-radius: 20px;
    padding: 50px 30px;
    max-width: 90%;
    width: 100%;
    /*max-height: calc(100vh - 145px);*/
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    position: relative;
    border: 2px solid var(--light-gold);
    overflow: hidden;
}

.main-content {
    max-height: calc(var(--vh, 1vh) * 100 - 245px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.main-content::-webkit-scrollbar {
    display: none;
}

/* Decorative border top */
.slide-content::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--gold),
        transparent
    );
    border-radius: 2px;
}

/* Corner decorations */
.slide-content .corner-decor {
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: var(--gold);
    border-style: solid;
    border-width: 0;
}

.slide-content .corner-decor.top-left {
    top: 8px;
    left: 8px;
    border-top-width: 2px;
    border-left-width: 2px;
    border-top-left-radius: 8px;
}

.slide-content .corner-decor.top-right {
    top: 8px;
    right: 8px;
    border-top-width: 2px;
    border-right-width: 2px;
    border-top-right-radius: 8px;
}

.slide-content .corner-decor.bottom-left {
    bottom: 8px;
    left: 8px;
    border-bottom-width: 2px;
    border-left-width: 2px;
    border-bottom-left-radius: 8px;
}

.slide-content .corner-decor.bottom-right {
    bottom: 8px;
    right: 8px;
    border-bottom-width: 2px;
    border-right-width: 2px;
    border-bottom-right-radius: 8px;
}

.slide-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-green);
    margin-bottom: 12px;
    margin-top: 10px;
    line-height: 1.3;
}

.slide-subtitle {
    font-size: 15px;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.slide-text {
    line-height: 2;
    color: #444;
}

/* Arabic Quran text styling */
.arabic-text {
    font-family:
        "KFGQPC Uthmanic Script HAFS", "Noto Sans Arabic", serif;
    font-size: var(--arabic-font-size);
    line-height: 2.2;
    direction: rtl;
    color: var(--dark-green);
    margin-bottom: 15px;
    display: block;
}

/* Translation text styling */
.translation-text {
    display: block;
    font-size: var(--translation-font-size);
    line-height: 2;
    color: #444;
}

/* Hide translation mode */
body.hide-translation .translation-text {
    display: none;
}

/* Star decoration */
.star-decor {
    color: var(--gold);
    font-size: 20px;
    margin: 15px 0;
    letter-spacing: 10px;
}

/* Progress Indicator */
.progress-indicator {
    color: var(--light-gold);
    font-size: 16px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.progress-indicator #currentSlide {
    color: var(--gold);
    font-size: 20px;
    font-weight: 700;
}

/* Navigation Container */
.nav-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 100;
}

/* Navigation Arrows */
.nav-arrow {
    width: 50px;
    height: 50px;
    background: rgba(201, 162, 39, 0.2);
    border: 1px solid var(--light-gold);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.nav-arrow:hover {
    background: rgba(201, 162, 39, 0.4);
}

.nav-arrow:active {
    transform: scale(0.95);
}

.nav-arrow svg {
    width: 20px;
    height: 20px;
    fill: var(--light-gold);
}

.nav-arrow.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Swipe hint */
.swipe-hint {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--light-gold);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeInOut 3s ease-in-out infinite;
    transition: opacity 0.5s ease;
}

.swipe-hint svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    animation: swipeAnim 1.5s ease-in-out infinite;
}

@keyframes swipeAnim {
    0%,
    100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-10px);
    }
}

@keyframes fadeInOut {
    0%,
    100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Hide swipe hint after first interaction */
.hide-hint .swipe-hint {
    opacity: 0;
    pointer-events: none;
}

/* Loading state */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        var(--dark-green) 0%,
        var(--primary-green) 100%
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(201, 162, 39, 0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    color: var(--light-gold);
    margin-top: 15px;
    font-family:
        "KFGQPC Uthmanic Script HAFS", "Noto Sans Arabic", serif;
    font-size: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Category Switch */
.category-switch {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 20px;
    padding: 3px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(232, 212, 139, 0.2);
}

.category-btn {
    padding: 6px 18px;
    border: none;
    background: transparent;
    color: rgba(232, 212, 139, 0.55);
    font-family: "Noto Sans Arabic", sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 16px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.3px;
}

.category-btn.active {
    background: rgba(201, 162, 39, 0.2);
    color: var(--light-gold);
}

.category-btn:hover:not(.active) {
    color: rgba(232, 212, 139, 0.8);
}

.category-btn svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

/* Responsive adjustments */
@media (max-width: 360px) {
    .slide-content {
        padding: 40px 25px;
    }
    .slide-title {
        font-size: 22px;
    }
    .slide-text {
        font-size: 14px;
    }
}

@media (min-height: 800px) {
    .slide-content {
        padding: 60px 35px;
    }
}

/* Hide nav buttons on mobile */
@media (max-width: 767px) {
    .nav-container {
        display: none;
    }
}

/* Desktop */
@media (min-width: 768px) {
    .slide-content {
        max-width: 680px;
    }
}

/* Settings Button */
.settings-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(232, 212, 139, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(12px);
    transition: all 0.25s ease;
}

.settings-btn:hover {
    background: rgba(201, 162, 39, 0.2);
    transform: rotate(30deg);
}

.settings-btn svg {
    width: 16px;
    height: 16px;
    fill: rgba(232, 212, 139, 0.55);
}

/* Settings Modal */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.settings-modal.active {
    opacity: 1;
    visibility: visible;
}

.settings-content {
    background: linear-gradient(180deg, #f0f5f0 0%, #e8f0e8 100%);
    border-radius: 20px;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--light-gold);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--light-gold);
}

.settings-header h3 {
    color: var(--dark-green);
    font-size: 18px;
    margin: 0;
}

.settings-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark-green);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.settings-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.settings-body {
    padding: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

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

.setting-item label {
    color: var(--dark-green);
    font-size: 14px;
    font-weight: 500;
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.size-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--gold);
    background: transparent;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    color: var(--dark-green);
    cursor: pointer;
    transition: all 0.3s ease;
}

.size-btn:hover {
    background: var(--gold);
    color: white;
}

.size-value {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
    color: var(--dark-green);
    font-size: 16px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--gold);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}
