
@font-face {
    font-family: 'htrakik';
    src: url('../fonts/htrakik/htrakik-regular.woff2') format('woff2'),
         url('../fonts/htrakik/htrakik-regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'htrakik';
    src: url('../fonts/htrakik/htrakik-medium.woff2') format('woff2'),
         url('../fonts/htrakik/htrakik-medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'htrakik';
    src: url('../fonts/htrakik/htrakik-semibold.woff2') format('woff2'),
         url('../fonts/htrakik/htrakik-semibold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'htrakik';
    src: url('../fonts/htrakik/htrakik-bold.woff2') format('woff2'),
         url('../fonts/htrakik/htrakik-bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'htrakik';
    src: url('../fonts/htrakik/htrakik-light.woff2') format('woff2'),
         url('../fonts/htrakik/htrakik-light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    font-family: 'htrakik', sans-serif;
    background: #0a0e27;
    color: #ffffff;
}

#svg-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
}

#svg-background svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#svg-background #cresent {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.5s ease;
}

#svg-background #mosque,
#svg-background #people {
    transform-box: view-box;
    transform-origin: 0 0;
    transition: transform 2.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 1.2s ease;
}

#svg-background #kaaba {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 2.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 1.2s ease;
}

#svg-background #clouds1,
#svg-background #clouds2 {
    transform-box: view-box;
    transform-origin: 0 0;
    transition: opacity 1.5s ease;
    will-change: transform, opacity;
}

#svg-background #clouds1 {
    animation: cloudDriftRight 90s ease-in-out infinite;
}
#svg-background #clouds2 {
    animation: cloudDriftLeft 110s ease-in-out infinite;
}

@keyframes cloudDriftRight {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(40px); }
}
@keyframes cloudDriftLeft {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(-40px); }
}

#svg-background #stars > g > path,
#svg-background #stars > path {
    transform-box: fill-box;
    transform-origin: center;
}

#svg-background #stars > g > path:nth-child(3n) {
    animation: twinkle1 2.8s ease-in-out infinite;
}
#svg-background #stars > g > path:nth-child(3n+1) {
    animation: twinkle2 3.6s ease-in-out infinite;
    animation-delay: 0.6s;
}
#svg-background #stars > g > path:nth-child(3n+2) {
    animation: starShimmer 4.4s ease-in-out infinite;
    animation-delay: 1.2s;
}

@keyframes twinkle1 {
    0%, 100% { opacity: 0.3; }
    50%      { opacity: 1; }
}
@keyframes twinkle2 {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 0.15; }
}
@keyframes twinkle3 {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 0.25; }
}

@keyframes starShimmer {
    0%, 100% { opacity: 0.2;  transform: scale(1); }
    50%      { opacity: 1;    transform: scale(1.35); }
}

@keyframes sparkleGlow {
    0%, 100% { opacity: 0.06; transform: scale(0.6) rotate(0deg); }
    50%      { opacity: 1;    transform: scale(1.5) rotate(45deg); }
}

.scene-animated #cresent {
    transform: translate(-820px, -50px) scale(0.45);
}

.scene-animated #mosque {
    transform: translateY(60px);
}

.scene-animated #people {
    transform: translateY(40px);
}

@media not (orientation: portrait) {
    .scene-animated #kaaba {
        transform: translate(-760px, 40px);
    }
}

@media (orientation: portrait) {
    .scene-animated #kaaba {
        transform: translateY(40px);
    }
}

.scene-animated #clouds1,
.scene-animated #clouds2 {
    opacity: 0.35;
}

@media (orientation: portrait) {
    #svg-background #cresent {
        transform: translate(-400px, 80px);
    }
    .scene-animated #cresent {
        transform: translate(-400px, 20px) scale(0.6);
    }
}

#app-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
    pointer-events: none;
}

#app-container.visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}


.app-header {
    text-align: center;
    margin-bottom: 32px;
    margin-top: 60px;
}

.app-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4),
                 0 0 40px rgba(255, 215, 0, 0.15);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.title-mobile {
    display: none;
}

.app-header p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 500px;
    margin: 0 auto;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 20px;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 215, 0, 0.2);
    border-top-color: #FFD700;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
}


.panel {
    display: none;
    animation: fadeSlideIn 0.5s ease;
    width: 100%;
    max-width: 960px;
}

#step2.panel {
    max-width: 1100px;
}

.panel.active {
    display: block;
}



@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}


.card-grid {
    position: relative;
    margin-bottom: 28px;
}

.carousel-track {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    min-width: 0;
}

@media (min-width: 640px) {
    .carousel-track {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 960px) {
    .card-grid {
        overflow: hidden;
    }
    .card-grid.has-carousel {
        padding: 0 52px;
    }
    .carousel-track {
        display: flex;
        gap: 0;
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .carousel-track .card-thumb {
        flex: 0 0 calc(25% - 6px);
        max-width: calc(25% - 6px);
        margin: 0 4px;
    }
}

@media (max-width: 959px) {
    .carousel-track {
        transform: none !important;
    }
}

.card-thumb {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(147, 112, 219, 0.3);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    aspect-ratio: 9 / 16;
}

.card-thumb:hover {
    border-color: #9370DB;
    box-shadow: 0 0 24px rgba(147, 112, 219, 0.4),
                0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-4px);
}

.card-thumb.selected {
    border-color: #FFD700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.35),
                0 4px 24px rgba(0, 0, 0, 0.3);
}

.card-thumb.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    background: #FFD700;
    color: #0a0e27;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
}

.card-thumb svg,
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* Carousel Navigation */
.carousel-arrow {
    display: none;
}

@media (min-width: 960px) {
    .carousel-arrow {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 44px;
        height: 44px;
        border-radius: 50%;
        border: 2px solid rgba(147, 112, 219, 0.4);
        background: rgba(10, 14, 39, 0.85);
        color: #FFD700;
        font-size: 1.3rem;
        cursor: pointer;
        z-index: 10;
        transition: all 0.3s ease;
        backdrop-filter: blur(8px);
        padding: 0;
        line-height: 1;
    }

    .carousel-arrow:hover {
        background: rgba(147, 112, 219, 0.25);
        border-color: #FFD700;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    }

    .carousel-prev {
        left: 4px;
    }

    .carousel-next {
        right: 4px;
    }
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 36px;
    border: none;
    border-radius: 14px;
    font-family: 'htrakik', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.35s ease;
    min-width: 150px;
    letter-spacing: 0.5px;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #0a0e27;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 215, 0, 0.5);
}

.btn-secondary {
    background: transparent;
    color: #9370DB;
    border: 2px solid rgba(147, 112, 219, 0.5);
}

.btn-secondary:hover:not(:disabled) {
    border-color: #9370DB;
    background: rgba(147, 112, 219, 0.1);
    box-shadow: 0 0 16px rgba(147, 112, 219, 0.3);
}

.btn-row {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}


.editor-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

.editor-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.editor-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    padding-bottom: 40px;

}

@media (min-width: 768px) {
    .editor-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 32px;
    }
    .editor-left {
        flex: 0 0 45%;
        max-width: 45%;
        position: sticky;
        top: 20px;
    }
    .editor-right {
        flex: 1;
    }
}

.preview-wrap {
    position: relative;
    width: 100%;
    max-width: 50%;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4),
                0 0 30px rgba(147, 112, 219, 0.15);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.preview-wrap svg {
    width: 100%;
    height: auto;
    display: block;
}

.input-group {
    width: 100%;
    max-width: 420px;
}

.input-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #FFD700;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(147, 112, 219, 0.3);
    border-radius: 14px;
    font-family: 'htrakik', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    background: rgba(255, 255, 255, 0.06);
    outline: none;
    transition: all 0.35s ease;
    backdrop-filter: blur(10px);
}

.input-group textarea {
    resize: vertical;
    min-height: 90px;
    line-height: 1.5;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: #FFD700;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.2),
                0 0 0 3px rgba(255, 215, 0, 0.08);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
}


.error-state {
    padding: 50px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
}


.zoom-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: pointer;
    animation: fadeSlideIn 0.25s ease;
}

.zoom-overlay svg {
    max-width: 95%;
    max-height: 95vh;
    border-radius: 14px;
}


.download-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.download-box {
    background: linear-gradient(135deg, #1a1f4e, #0f1235);
    padding: 36px 48px;
    border-radius: 18px;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(147, 112, 219, 0.2);
    border: 1px solid rgba(147, 112, 219, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.download-box p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}


@media (max-width: 767px) {
    .scene-animated #crescent {
        transform: translate(760px, 50px) scale(0.3);
    }
}

@media (max-width: 767px) {
    #step1 .btn-row {
        position: fixed;
        bottom: 36px;
        left: 0;
        right: 0;
        z-index: 100;
        padding: 16px 20px 20px;
        display: none;
        justify-content: center;
    }
    #step1 .btn-row.sticky-visible {
        display: flex;
    }
    #step1 .btn-row .btn {
        width: 100%;
        max-width: 360px;
    }
    #step1 .card-grid {
        padding-bottom: 80px;
    }
}

@media (max-width: 767px) {
    .title-desktop {
        display: none !important;
    }
    .title-mobile {
        display: block !important;
    }
    .app-header {
        background: #0a0e2762;
        padding: 14px 18px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1.1rem;
    }
    .app-header {
        margin-top: 30px;
    }
    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
        min-width: 120px;
    }
}


.site-footer {
    position: fixed;
    bottom: 16px;
    right: 24px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.site-footer:hover {
    opacity: 1;
}

.footer-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.footer-logo {
    height: 20px;
    width: auto;
}

@media (max-width: 767px) {
    .site-footer {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        bottom: 10px;
        background: #0a0e27;
        padding: 6px 14px;
        border-radius: 8px;
    }
}
