/* ------------------------------------------------
   Custom styles for Arti49 Story Generator
   (Tailwind via CDN handles the majority of styling)
   ------------------------------------------------ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;800;900&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --red: #bf1422;
    --red-dark: #8f0f19;
    --navy: #06172d;
    --blue: #002b66;
    --ink: #101828;
    --muted: #667085;
    --label: #344054;
    --line: #d9e2ee;
    --soft: #eef2f6;
    --white: #ffffff;
    font-family: Inter, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
}

body {
    color: var(--ink);
    background: #f5f7fb;
    font-family: Inter, Arial, sans-serif;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

/* ---- Font ---- */
@font-face {
    font-family: 'Molde Condensed';
    src: url('../assets/fonts/Molde-Condensed-Bold.woff2') format('woff2'),
         url('../assets/fonts/Molde-Condensed-Bold.woff')  format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Molde Condensed';
    src: url('../assets/fonts/Molde-Condensed-Black.woff2') format('woff2'),
         url('../assets/fonts/Molde-Condensed-Black.woff')  format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ---- Shared light theme ---- */
.story-body.bg-gray-950 {
    background: #f5f7fb !important;
    color: var(--ink) !important;
}

.story-body .bg-gray-900,
.login-body .bg-gray-900 {
    background: var(--white) !important;
}

.story-body .bg-gray-800,
.login-body .bg-gray-800 {
    background: var(--white) !important;
}

.story-body .bg-gray-700 {
    background: var(--line) !important;
}

.story-body .border-gray-800,
.story-body .border-gray-700,
.story-body .border-gray-600,
.login-body .border-gray-800,
.login-body .border-gray-700,
.login-body .border-gray-600 {
    border-color: var(--line) !important;
}

.story-body .text-gray-400,
.login-body .text-gray-400 {
    color: var(--label) !important;
}

.story-body .text-gray-500,
.story-body .text-gray-600,
.login-body .text-gray-500 {
    color: var(--muted) !important;
}

.story-body input.text-white,
.story-body textarea.text-white,
.login-body input.text-white,
.login-body h1.text-white,
.story-body .style-btn .text-white,
.story-body button.bg-gray-800.text-white {
    color: var(--ink) !important;
}

.story-body input,
.story-body textarea,
.login-body input {
    border-color: var(--line) !important;
    border-radius: 6px !important;
    background: var(--white) !important;
    color: var(--ink) !important;
    outline: none;
}

.story-body input::placeholder,
.story-body textarea::placeholder,
.login-body input::placeholder {
    color: #98a2b3 !important;
}

.story-body input:focus,
.story-body textarea:focus,
.login-body input:focus {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 3px rgba(191, 20, 34, 0.14) !important;
}

.story-body .bg-red-700,
.login-body .bg-red-700 {
    background: var(--red) !important;
}

.story-body .hover\:bg-red-600:hover,
.login-body .hover\:bg-red-600:hover {
    background: var(--red-dark) !important;
}

.story-body .bg-sky-600 {
    background: var(--blue) !important;
}

.story-body .hover\:bg-sky-500:hover {
    background: #0a3f86 !important;
}

.story-body .hover\:bg-gray-700:hover {
    background: #fff5f5 !important;
}

.story-body .hover\:border-gray-600:hover {
    border-color: var(--red) !important;
}

.story-body .rounded-xl,
.story-body .rounded-2xl,
.login-body .rounded-xl,
.login-body .rounded-2xl {
    border-radius: 8px !important;
}

.story-body .shadow-2xl,
.login-body .shadow-2xl {
    box-shadow: 0 18px 56px rgba(16, 24, 40, 0.12) !important;
}

.story-body section.bg-gray-900,
.story-body div.bg-gray-900 {
    box-shadow: 0 14px 44px rgba(16, 24, 40, 0.08);
}

.story-body button[disabled],
.login-body button[disabled] {
    cursor: not-allowed;
}

/* ---- Insta-post aligned header ---- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 74px;
    padding: 12px clamp(16px, 3vw, 34px);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
}

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

.brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.brand strong {
    display: block;
    color: var(--ink);
    font-family: "Barlow Condensed", "Molde Condensed", Inter, sans-serif;
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

.brand span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.logout-link {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 14px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    background: var(--white);
}

.logout-link:hover {
    border-color: var(--red);
    color: var(--red);
}

.story-shell {
    padding: 16px clamp(14px, 2vw, 26px) 24px;
}

/* ---- Login screen ---- */
.login-body {
    background:
        linear-gradient(145deg, rgba(6, 23, 45, 0.94), rgba(0, 43, 102, 0.86)),
        radial-gradient(circle at 20% 20%, rgba(191, 20, 34, 0.34), transparent 32%),
        #06172d;
}

.login-body .bg-gray-900 {
    border-color: rgba(255, 255, 255, 0.16) !important;
    background: rgba(255, 255, 255, 0.96) !important;
}

.login-body h1 {
    font-family: "Barlow Condensed", "Molde Condensed", Inter, sans-serif;
    font-size: 38px;
    font-weight: 900;
    line-height: 0.95;
}

/* ---- Canvas interaction ---- */
#storyCanvas {
    cursor: grab;
}
#storyCanvas:active {
    cursor: grabbing;
}

/* ---- Range input track (Webkit) ---- */
input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: var(--line);
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #dc2626;
    margin-top: -5px;
    cursor: pointer;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: #eef2f6; }
::-webkit-scrollbar-thumb { background: #c7d2df; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #98a2b3; }

@media (max-width: 720px) {
    .topbar {
        align-items: flex-start;
    }

    .brand strong {
        font-size: 24px;
    }

    .brand span {
        display: none;
    }
}
