/*
==================================================
IMPA CLOUD — MASTER THEME V1
Light Purple Design System
==================================================
*/

/* ---------- 1. ตัวแปรสีหลัก ---------- */

:root {
    --impa-bg: #f7f3ff;
    --impa-bg-soft: #fbf9ff;
    --impa-surface: #ffffff;
    --impa-surface-soft: #faf7ff;

    --impa-purple: #6a3de8;
    --impa-purple-dark: #5730c7;
    --impa-purple-light: #a986ff;
    --impa-purple-pale: #e8dcff;

    --impa-text: #2f2140;
    --impa-text-soft: #554b61;
    --impa-muted: #756b82;

    --impa-border: rgba(106, 61, 232, 0.16);
    --impa-border-strong: rgba(106, 61, 232, 0.26);

    --impa-success: #4f9d75;
    --impa-danger: #b74747;

    --impa-radius-sm: 14px;
    --impa-radius-md: 18px;
    --impa-radius-lg: 24px;
    --impa-radius-xl: 28px;

    --impa-shadow-sm:
        0 8px 22px rgba(75, 39, 105, 0.07);

    --impa-shadow-md:
        0 12px 30px rgba(75, 39, 105, 0.09);

    --impa-shadow-lg:
        0 18px 45px rgba(106, 61, 232, 0.16);

    --impa-hero:
        linear-gradient(
            120deg,
            #d9c0ff 0%,
            #b184ff 45%,
            #8c5be8 100%
        );
}


/* ---------- 2. Reset ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;

    background:
        radial-gradient(
            circle at top right,
            rgba(106, 61, 232, 0.10),
            transparent 35%
        ),
        radial-gradient(
            circle at bottom left,
            rgba(169, 134, 255, 0.08),
            transparent 40%
        ),
        var(--impa-bg);

    color: var(--impa-text);

    font-family:
        Arial,
        "Noto Sans Thai",
        "Segoe UI",
        sans-serif;

    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
video {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}


/* ---------- 3. โครงหน้าหลัก ---------- */

.page,
.container,
.main-container {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 28px 18px 60px;
}

.content {
    width: 100%;
}


/* ---------- 4. แถบด้านบน ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 18px 20px;

    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--impa-border);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.brand {
    color: var(--impa-purple);
    font-size: 20px;
    font-weight: 850;
    letter-spacing: -0.2px;
}

.back-link,
.topbar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 10px 18px;

    border: 1px solid transparent;
    border-radius: 999px;

    background: var(--impa-purple);
    color: #ffffff;

    font-size: 15px;
    font-weight: 750;

    box-shadow: var(--impa-shadow-sm);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.back-link:hover,
.topbar-link:hover {
    transform: translateY(-1px);
    background: var(--impa-purple-dark);
    box-shadow: var(--impa-shadow-md);
}


/* ---------- 5. Hero / Cover ---------- */

.hero,
.cover,
.page-hero {
    position: relative;
    overflow: hidden;

    padding: 34px 22px;
    border-radius: var(--impa-radius-xl);

    background: var(--impa-hero);
    color: #ffffff;

    box-shadow: var(--impa-shadow-lg);
}

.hero::before,
.cover::before,
.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;

    background:
        radial-gradient(
            circle at 22% 25%,
            rgba(255, 255, 255, 0.24),
            transparent 26%
        ),
        radial-gradient(
            circle at 82% 75%,
            rgba(255, 255, 255, 0.10),
            transparent 30%
        );
}

.hero > *,
.cover > *,
.page-hero > * {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 10px;

    color: rgba(255, 255, 255, 0.94);

    font-size: 13px;
    font-weight: 850;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.hero h1,
.cover h1,
.page-hero h1 {
    margin: 0;

    color: #ffffff;

    font-size: clamp(34px, 8vw, 58px);
    line-height: 1.05;
    letter-spacing: -1px;
}

.hero p,
.cover p,
.page-hero p {
    max-width: 680px;
    margin: 14px 0 0;

    color: rgba(255, 255, 255, 0.96);

    font-size: 16px;
    line-height: 1.75;
}


/* ---------- 6. ปุ่ม ---------- */

.actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.button,
.btn,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 50px;
    padding: 12px 18px;

    border: 0;
    border-radius: 16px;

    cursor: pointer;

    font-weight: 800;
    text-align: center;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.button:hover,
.btn:hover {
    transform: translateY(-1px);
}

.button.primary,
.btn-primary,
.primary-button {
    background: #ffffff;
    color: var(--impa-purple-dark);

    box-shadow:
        0 8px 24px rgba(48, 20, 76, 0.14);
}

.button.secondary,
.btn-secondary,
.secondary-button {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;

    border: 1px solid rgba(255, 255, 255, 0.38);
}

.button-purple {
    background: var(--impa-purple);
    color: #ffffff;

    box-shadow: var(--impa-shadow-sm);
}

.button-purple:hover {
    background: var(--impa-purple-dark);
}


/* ---------- 7. การ์ดและ Section ---------- */

.card,
.section,
.panel,
.content-card {
    margin-top: 24px;
    padding: 24px 20px;

    border: 1px solid var(--impa-border);
    border-radius: var(--impa-radius-lg);

    background: var(--impa-surface);

    box-shadow: var(--impa-shadow-md);
}

.section h2,
.card h2,
.panel h2 {
    margin: 0 0 16px;

    color: var(--impa-purple-dark);

    font-size: 23px;
    line-height: 1.3;
}

.section-note {
    margin: -6px 0 18px;

    color: var(--impa-muted);

    line-height: 1.7;
}


/* ---------- 8. กฎและรายการข้อมูล ---------- */

.rules,
.info-list,
.feature-list {
    display: grid;
    gap: 12px;
}

.rule,
.info-item,
.feature-item {
    padding: 15px 16px;

    border: 1px solid var(--impa-border);
    border-radius: 16px;

    background: var(--impa-surface-soft);

    color: var(--impa-text);
    line-height: 1.65;
}

.rule strong,
.info-item strong,
.feature-item strong {
    color: var(--impa-purple-dark);
}


/* ---------- 9. License Box ---------- */

.license-box {
    margin-top: 18px;
    padding: 20px;

    border: 1px solid var(--impa-border-strong);
    border-radius: var(--impa-radius-md);

    background:
        linear-gradient(
            135deg,
            #fbf8ff 0%,
            #f0e5ff 100%
        );
}

.license-box h3 {
    margin: 0 0 10px;

    color: var(--impa-purple-dark);

    font-size: 21px;
}

.license-box p {
    margin: 0;

    color: var(--impa-text-soft);

    line-height: 1.75;
}


/* ---------- 10. Empty State ---------- */

.empty-state {
    padding: 32px 16px;

    border: 1px dashed var(--impa-border-strong);
    border-radius: 20px;

    background: var(--impa-bg-soft);

    text-align: center;
}

.empty-state .icon {
    margin-bottom: 10px;
    font-size: 42px;
}

.empty-state h3 {
    margin: 0 0 8px;

    color: var(--impa-purple-dark);

    font-size: 20px;
}

.empty-state p {
    margin: 0;

    color: var(--impa-muted);

    line-height: 1.7;
}


/* ---------- 11. Profile ---------- */

.profile-card {
    overflow: hidden;

    border: 1px solid var(--impa-border);
    border-radius: var(--impa-radius-xl);

    background: var(--impa-surface);

    box-shadow: var(--impa-shadow-lg);
}

.profile-cover {
    min-height: 180px;

    background: var(--impa-hero);
}

.profile-avatar {
    display: grid;
    place-items: center;

    width: 150px;
    height: 150px;

    border: 7px solid var(--impa-text);
    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            var(--impa-purple-light),
            var(--impa-purple-dark)
        );

    color: var(--impa-text);

    font-size: 54px;

    box-shadow: var(--impa-shadow-md);
}

.profile-bio,
.profile-description {
    color: var(--impa-text-soft);
}


/* ---------- 12. สถิติ ---------- */

.stats,
.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.stat,
.stat-card {
    padding: 22px 12px;

    border: 1px solid var(--impa-border);
    border-radius: var(--impa-radius-md);

    background: var(--impa-bg-soft);

    text-align: center;
}

.stat strong,
.stat-number {
    display: block;

    color: var(--impa-text);

    font-size: clamp(25px, 5vw, 34px);
    line-height: 1.2;
}

.stat span,
.stat-label {
    display: block;
    margin-top: 8px;

    color: var(--impa-muted);
}


/* ---------- 13. Grid ผลงาน ---------- */

.works-grid,
.cards-grid,
.media-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.work-card,
.media-card,
.item-card {
    min-height: 210px;
    padding: 20px;

    border: 1px solid var(--impa-border);
    border-radius: var(--impa-radius-md);

    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            #faf7ff 100%
        );
}

.work-card h3,
.media-card h3,
.item-card h3 {
    margin: 14px 0 4px;

    color: var(--impa-text);

    font-size: 18px;
    line-height: 1.35;
}

.work-card p,
.media-card p,
.item-card p {
    margin: 0;

    color: var(--impa-muted);
}


/* ---------- 14. แบบฟอร์ม ---------- */

.form-group {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

label {
    color: var(--impa-text);
    font-weight: 750;
}

input,
textarea,
select {
    width: 100%;

    padding: 14px 16px;

    border: 1px solid var(--impa-border-strong);
    border-radius: 15px;

    outline: none;

    background: #ffffff;
    color: var(--impa-text);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--impa-purple);

    box-shadow:
        0 0 0 4px rgba(106, 61, 232, 0.10);
}

input::placeholder,
textarea::placeholder {
    color: #9a91a5;
}


/* ---------- 15. Upload ---------- */

.upload-card {
    padding: 26px 22px;

    border: 1px solid var(--impa-border);
    border-radius: var(--impa-radius-xl);

    background: #ffffff;

    box-shadow: var(--impa-shadow-lg);
}

.upload-zone {
    padding: 22px;

    border: 2px dashed rgba(106, 61, 232, 0.38);
    border-radius: var(--impa-radius-md);

    background: var(--impa-bg-soft);
}

.upload-button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 54px;
    margin-top: 16px;

    border: 0;
    border-radius: 16px;

    background: var(--impa-purple);
    color: #ffffff;

    font-weight: 850;
    cursor: pointer;

    box-shadow: var(--impa-shadow-sm);
}

.upload-button:hover {
    background: var(--impa-purple-dark);
}


/* ---------- 16. ข้อความสถานะ ---------- */

.alert,
.message {
    margin-top: 16px;
    padding: 14px 16px;

    border-radius: 14px;

    line-height: 1.6;
}

.alert-success,
.message-success {
    border: 1px solid rgba(79, 157, 117, 0.28);
    background: rgba(79, 157, 117, 0.10);
    color: #316e50;
}

.alert-error,
.message-error {
    border: 1px solid rgba(183, 71, 71, 0.26);
    background: rgba(183, 71, 71, 0.08);
    color: #943c3c;
}


/* ---------- 17. Footer ---------- */

footer,
.footer {
    padding: 34px 18px 44px;

    color: var(--impa-muted);

    text-align: center;
}


/* ---------- 18. Responsive ---------- */

@media (max-width: 720px) {
    .page,
    .container,
    .main-container {
        padding: 22px 16px 48px;
    }

    .hero,
    .cover,
    .page-hero {
        padding: 30px 20px;
        border-radius: 26px;
    }

    .actions {
        grid-template-columns: 1fr;
    }

    .stats,
    .profile-stats {
        gap: 10px;
    }

    .stat,
    .stat-card {
        padding: 18px 8px;
    }
}

@media (max-width: 520px) {
    .topbar {
        padding: 15px 16px;
    }

    .brand {
        font-size: 18px;
    }

    .back-link,
    .topbar-link {
        min-height: 42px;
        padding: 9px 14px;
        font-size: 14px;
    }

    .hero h1,
    .cover h1,
    .page-hero h1 {
        font-size: 38px;
    }

    .hero p,
    .cover p,
    .page-hero p {
        font-size: 16px;
    }

    .card,
    .section,
    .panel,
    .content-card {
        padding: 21px 17px;
    }

    .works-grid,
    .cards-grid,
    .media-grid {
        gap: 10px;
    }

    .work-card,
    .media-card,
    .item-card {
        min-height: 190px;
        padding: 17px;
    }
}