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

[hidden] {
    display: none !important;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont,
    "Segoe UI", Arial, sans-serif;
    color: #222222;
    background:
    radial-gradient(circle at 15% 15%,
    #fff1ad 0%, transparent 40%),
    radial-gradient(circle at 90% 90%,
    #ffe88a 0%, transparent 45%),
    #fffdf5;
}

/* الخلفية المتحركة */

#network {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* التمرير المستقل */

.page-scroll {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1;
    padding: 100px 16px 65px;
    -webkit-overflow-scrolling: touch;
}

/* المربع الرئيسي */

.panel {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 65px 17px 25px;
    background: rgba(255,255,255,.96);
    border: 1px solid #efd46b;
    border-radius: 28px;
    text-align: center;
    box-shadow:
    0 15px 45px #c8a63c25,
    0 0 30px #ffdf5435;
}

/* الصورة الدائرية */

.avatar {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 90px;
    border: 3px solid #efc51d;
    outline: 4px solid white;
    border-radius: 50%;
    background: #fffdf5;
    box-shadow: 0 0 25px #edc31c88;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#avatarPlaceholder {
    font-weight: 900;
    color: #b18c13;
}

.brand {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #a28c43;
    margin-bottom: 14px;
}

/* العنوان والرمز الأزرق */

.title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

h1 {
    font-size: clamp(21px, 5.5vw, 26px);
    font-weight: 900;
    line-height: 1.5;
}

.verified {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.date {
    color: #9c811f;
    font-size: 15px;
    font-weight: 700;
    margin-top: 7px;
}

/* حالة القسيمة */

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff8d9;
    border: 1px solid #efda91;
    border-radius: 30px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    margin: 19px 0;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dfb51a;
    box-shadow: 0 0 10px #ffd52b;
}

/* صورة القسيمة */

.ticket {
    width: 100%;
    min-height: 245px;
    border: 1.5px solid #e9c12d;
    border-radius: 20px;
    background: linear-gradient(
        140deg,
        #fff4c4,
        #ffffff 45%,
        #ffffff 65%,
        #fff3bf
    );
    box-shadow: 0 4px 22px #e9c32630;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ticket img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

#ticketPlaceholder {
    padding: 35px 10px;
    color: #a18b41;
    font-weight: 800;
}

.image-icon {
    display: block;
    font-size: 48px;
    margin-bottom: 12px;
}

#description {
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

#description:empty {
    display: none;
}

/* الأزرار */

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    min-width: 0;
    min-height: 55px;
    padding: 12px 7px;
    border-radius: 15px;
    border: 1px solid #e4bd2a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #292211;
    text-decoration: none;
    font-size: clamp(12px, 3.4vw, 15px);
    font-weight: 800;
    transition: transform .2s;
}

.whatsapp {
    background: linear-gradient(
        120deg,
        #ffe77b,
        #ffd21a
    );
    animation: yellowGlow 2s infinite;
}

.tomorrow {
    background: #fffdf4;
    box-shadow: 0 4px 15px #ddbb2220;
}

.tomorrow span {
    font-size: 24px;
}

.btn:active {
    transform: scale(.96);
}

.btn[aria-disabled="true"] {
    pointer-events: none;
    opacity: .65;
}

@keyframes yellowGlow {
    0%, 100% {
        box-shadow: 0 0 9px #ffd32355;
    }

    50% {
        box-shadow:
        0 0 17px #ffd32399,
        0 0 27px #ffd32355;
    }
}

footer {
    margin-top: 22px;
    color: #a49365;
    font-size: 11px;
    font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}


/* الإطار الذهبي المتحرك */

.avatar {
    overflow: visible;
    isolation: isolate;
    border: none;
    outline: none;
    box-shadow: 0 0 25px #ffd32388;
}

.avatar::before {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: conic-gradient(
        #e8b823,
        #fff9cd,
        #ffd323,
        #ffffff,
        #e8b823
    );
    animation: goldenRing 2.5s linear infinite;
    z-index: -1;
    box-shadow:
        0 0 15px #ffd32399,
        0 0 30px #ffd32355;
}

.avatar img {
    border-radius: 50%;
    border: 3px solid white;
    position: relative;
}

@keyframes goldenRing {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}


/* حركة الدخول الاحترافية */

.panel {
    animation: panelEntrance 0.85s ease-out both;
}

.avatar {
    animation: avatarEntrance 0.7s ease-out both;
}

.brand {
    animation: contentEntrance 0.6s 0.25s both;
}

.title-row {
    animation: contentEntrance 0.6s 0.35s both;
}

.date {
    animation: contentEntrance 0.6s 0.45s both;
}

.status {
    animation: contentEntrance 0.6s 0.5s both;
}

.ticket {
    animation: contentEntrance 0.65s 0.55s both;
}

.buttons {
    animation: contentEntrance 0.6s 0.75s both;
}

footer {
    animation: contentEntrance 0.6s 0.85s both;
}


/* حركة المربع الرئيسي */

@keyframes panelEntrance {
    from {
        opacity: 0;
        transform: translateY(45px) scale(0.95);
    }

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


/* حركة ظهور الشعار */

@keyframes avatarEntrance {
    from {
        opacity: 0;
        transform: translateX(-50%) scale(0.3);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}


/* ظهور النصوص والصور */

@keyframes contentEntrance {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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


/* احترام إعداد تقليل الحركة */

@media (prefers-reduced-motion: reduce) {
    .panel,
    .avatar,
    .avatar::before,
    .brand,
    .title-row,
    .date,
    .status,
    .ticket,
    .buttons,
    footer {
        animation: none !important;
    }
}


/* =================================
   JOTA DYNAMIC THEME
================================= */

:root {
    --background-color: #fffdf5;
    --accent-color: #ffd323;
    --logo-size: 90px;
    --card-width: 440px;
    --title-size: 26px;
    --glow-size: 24px;
    --glow-level: 60%;

    --accent-light: color-mix(
        in srgb, var(--accent-color) 12%, white
    );

    --accent-dark: color-mix(
        in srgb, var(--accent-color) 40%, #222222
    );

    --glow-color: color-mix(
        in srgb,
        var(--accent-color) var(--glow-level),
        transparent
    );
}


/* لون الخلفية */

body {
    background:
        radial-gradient(
            circle at 15% 15%,
            color-mix(
                in srgb,
                var(--accent-color) 25%,
                transparent
            ),
            transparent 45%
        ),

        radial-gradient(
            circle at 90% 90%,
            color-mix(
                in srgb,
                var(--accent-color) 35%,
                transparent
            ),
            transparent 45%
        ),

        var(--background-color);
}


/* حجم المربع الرئيسي */

.panel {
    max-width: var(--card-width);

    padding-top: calc(
        var(--logo-size) * 0.5 + 20px
    );

    border-color: var(--accent-color);

    box-shadow:
        0 15px 45px #00000010,
        0 0 var(--glow-size) var(--glow-color);
}


/* المسافة أعلى الموقع */

.page-scroll {
    padding-top: calc(
        var(--logo-size) * 0.5 + 55px
    );
}


/* حجم الصورة الدائرية */

.avatar {
    width: var(--logo-size);
    height: var(--logo-size);

    top: calc(var(--logo-size) * -0.5);

    background: var(--accent-light);

    box-shadow:
        0 0 var(--glow-size) var(--glow-color);
}


/* الإطار الدوار */

.avatar::before {

    background: conic-gradient(
        var(--accent-color),
        white,
        var(--accent-color),
        white,
        var(--accent-color)
    );

    box-shadow:
        0 0 var(--glow-size) var(--glow-color);
}


/* حجم العنوان */

h1 {
    font-size: var(--title-size);
    overflow-wrap: anywhere;
}

.brand,
.date,
footer,
#avatarPlaceholder {
    color: var(--accent-dark);
}


/* حالة القسيمة */

.status {
    background: var(--accent-light);
    border-color: var(--accent-color);
}

.status-dot {
    background: var(--accent-color);

    box-shadow:
        0 0 var(--glow-size) var(--glow-color);
}


/* إطار صورة القسيمة */

.ticket {

    border-color: var(--accent-color);

    background: linear-gradient(
        140deg,
        var(--accent-light),
        white 45%,
        white 65%,
        var(--accent-light)
    );

    box-shadow:
        0 0 var(--glow-size) var(--glow-color);
}

#ticketPlaceholder {
    color: var(--accent-dark);
}


/* ألوان الأزرار */

.btn {
    border-color: var(--accent-color);
}

.whatsapp {

    background: linear-gradient(
        120deg,

        color-mix(
            in srgb,
            var(--accent-color) 65%,
            white
        ),

        var(--accent-color)
    );
}

.tomorrow {
    background: var(--accent-light);
    box-shadow: none;
}


/* الإضاءة المتغيرة */

@keyframes yellowGlow {

    0%, 100% {
        box-shadow:
            0 0 calc(var(--glow-size) * 0.5)
            var(--glow-color);
    }

    50% {
        box-shadow:
            0 0 var(--glow-size)
            var(--glow-color);
    }

}


/* إيقاف الإطار الدوار */

html[data-ring="off"] .avatar::before {
    animation: none !important;
    background: var(--accent-color);
}


/* التحكم بحركة الدخول */

html:not(.theme-ready) .panel,
html:not(.theme-ready) .avatar,
html:not(.theme-ready) .brand,
html:not(.theme-ready) .title-row,
html:not(.theme-ready) .date,
html:not(.theme-ready) .status,
html:not(.theme-ready) .ticket,
html:not(.theme-ready) .buttons,
html:not(.theme-ready) footer,

html[data-entrance="off"] .panel,
html[data-entrance="off"] .avatar,
html[data-entrance="off"] .brand,
html[data-entrance="off"] .title-row,
html[data-entrance="off"] .date,
html[data-entrance="off"] .status,
html[data-entrance="off"] .ticket,
html[data-entrance="off"] .buttons,
html[data-entrance="off"] footer {

    animation: none !important;

}

/* تأثير الضغط على صورة القسيمة */

.ticket {
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.ticket:has(img:not([hidden])) {
    cursor: pointer;
}

.ticket:has(img:not([hidden])):active {
    transform: scale(0.96);

    box-shadow:
        0 0 25px var(--accent-color),
        0 0 45px var(--glow-color);
}

#ticketImage {
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    .ticket:active {
        transform: none;
    }
}

/* الموجة الضوئية عند اللمس */

.ticket {
    position: relative;
    overflow: hidden;
}

.ticket-ripple {
    position: absolute;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--accent-color);
    pointer-events: none;
    opacity: 0.4;
    z-index: 5;
    animation: ticketRipple 0.6s ease-out forwards;
}

@keyframes ticketRipple {
    from {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.4;
    }

    to {
        transform: translate(-50%, -50%) scale(60);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ticket-ripple {
        display: none;
    }
}
