:root{
    --bg1:#FF4D2E;
    --bg2:#F2B705;
    --ink:#111111;
    --paper:#ffffff;
    --muted:#3a3a3a;
    --shadow: 8px 8px 0 rgba(0,0,0,0.18);
    --stroke: 4px solid var(--ink);
    --radius: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
    margin:0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    color: var(--ink);
    background:
      radial-gradient(900px 500px at 20% 15%, #FFF3B0 0%, rgba(255,243,176,0) 60%),
      linear-gradient(135deg, var(--bg1), var(--bg2));
}

a{ color: var(--ink); text-decoration:none; }
a:hover{ text-decoration:underline; }

.topbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:16px 20px;
    position: relative;
    z-index: 10;
}

.brand{
    display:flex;
    align-items:center;
    gap:10px;
    /*background: rgba(255,255,255,0.6);*/
    border: var(--stroke);
    box-shadow: var(--shadow);
    border-radius: 999px;
    padding:10px 10px;
}

.brand-logo-img{
    height: 40px;
    width: auto;
    display: block;
}

.toplinks{
    display:flex;
    gap:14px;
    flex-wrap:wrap;
}
.toplinks a{
    background: rgba(255,255,255,0.55);
    border: 2px solid rgba(17,17,17,0.8);
    border-radius: 999px;
    padding:8px 12px;
}

.hero{
    padding: 10px 18px 40px;
}

.hero-card{
    max-width: 1100px;
    margin: 0 auto;
    background: rgba(255,255,255,0.72);
    border: var(--stroke);
    border-radius: 26px;
    box-shadow: 12px 12px 0 rgba(0,0,0,0.20);
    backdrop-filter: blur(6px);
    overflow:hidden;
}

.hero-grid{
    display:grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 0;
}

.comic{
    padding: 18px;
    border-right: var(--stroke);
    background: transparent;
    display: flex;
    flex-direction: column;
}
.comic-img{
    width:100%;
    height:auto;
    display:block;
    object-fit: contain;
}

.panel{
    padding: 22px 22px 18px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.title{
    margin: 0 0 6px;
    font-size: 34px;
    line-height: 1.15;
    letter-spacing: -0.4px;
}
.subtitle{
    margin: 0 0 16px;
    color: rgba(17,17,17,0.82);
    font-weight: 600;
}

.comic-box{
    border: var(--stroke);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--paper);
    padding: 16px;
    cursor: pointer;
    transition: transform .08s ease;
}

.comic-box:hover{
    transform: translate(-2px, -2px);
    box-shadow: 10px 10px 0 rgba(0,0,0,0.18);
}

.comic-box.dragover{
    background: rgba(242,183,5,0.15);
    border-color: var(--bg2);
}

.hint-strong{ margin:0 0 6px; font-weight:900; }
.hint-soft{ margin:0 0 10px; color: rgba(17,17,17,0.72); }
.hint-meta{ margin:0; color: rgba(17,17,17,0.75); font-size: 13px; line-height:1.4; }

#fileInput{ display:none; }

.actions{
    display:flex;
    align-items:center;
    gap: 12px;
    flex-wrap:wrap;
    margin-top: 14px;
}

.btn{
    appearance:none;
    border: var(--stroke);
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 900;
    font-size: 16px;
    box-shadow: var(--shadow);
    cursor:pointer;
    transition: transform .08s ease;
    background: var(--paper);
}
.btn:active{ transform: translate(2px,2px); box-shadow: 5px 5px 0 rgba(0,0,0,0.18); }
.btn[disabled]{ opacity:0.55; cursor:not-allowed; }

.btn-primary{
    background: #F2B705;
}
.chip{
    display:inline-flex;
    align-items:center;
    border: 2px dashed rgba(17,17,17,0.8);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.6);
    font-weight: 700;
    font-size: 13px;
}

.error{
    margin-top:12px;
    color:#b40000;
    font-weight:800;
    display: none;
}

.error.active{
    display: block;
}

.progress-container,
.edit-form,
.download-section{
    display:none; /* JS will toggle */
    margin-top: 16px;
}

.progress-container.active,
.edit-form.active,
.download-section.active{
    display: block;
}

/* Ensure progress container is always visible when active */
.progress-container.active {
    display: block !important;
}

.download-section .section-title {
    margin-bottom: 16px;
}

.download-section .btn-primary {
    margin-top: 0;
}

.progress-bar{
    height: 18px;
    border: var(--stroke);
    border-radius: 999px;
    background: rgba(255,255,255,0.7);
    overflow:hidden;
    box-shadow: var(--shadow);
}
.progress-fill{
    height:100%;
    width:0%;
    background: #F2B705;
    color:#111;
    font-weight:900;
    font-size: 12px;
    display:flex;
    align-items:center;
    justify-content:center;
    transition: width .25s ease;
    position: relative;
    overflow: hidden;
}

/* Loading animation for processing states */
.progress-fill.loading {
    background: linear-gradient(
        90deg,
        #F2B705 0%,
        #FFD700 50%,
        #F2B705 100%
    );
    background-size: 200% 100%;
    animation: progress-loading 1.5s ease-in-out infinite;
}

.progress-fill.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: progress-shine 2s ease-in-out infinite;
}

@keyframes progress-loading {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 0%;
    }
}

@keyframes progress-shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.status-message{
    margin-top: 8px;
    color: rgba(17,17,17,0.75);
    font-weight: 600;
    font-size: 13px;
}

.section-title{
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 900;
}
.section-note{
    margin: 0 0 14px;
    color: rgba(17,17,17,0.7);
    font-weight: 600;
    font-size: 13px;
}

.disclaimer {
    margin-top: auto;
    padding-top: 20px;
}

.disclaimer p {
    margin: 0;
    color: rgba(17,17,17,0.65);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
}

.form-grid{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.form-group{
    display:flex;
    flex-direction:column;
    gap:6px;
}
.form-group.full{ grid-column: 1 / -1; }

.edit-form .btn-primary{
    margin-top: 16px;
}

label{ font-weight:900; }
input[type="text"], input[type="number"], input[type="file"]{
    border: 3px solid rgba(17,17,17,0.9);
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 14px;
    outline:none;
}
input:focus{
    box-shadow: 0 0 0 4px rgba(242,183,5,0.35);
}

.cover-preview{
    display:none;
    margin-top:10px;
    width: 140px;
    height: 140px;
    object-fit: cover;
    border: var(--stroke);
    border-radius: 18px;
    box-shadow: var(--shadow);
    background:#fff;
}

.cover-preview.active{
    display: block;
}

.seo-block{
    margin-top: 18px;
    border-top: 3px dashed rgba(17,17,17,0.55);
    padding-top: 14px;
    color: rgba(17,17,17,0.85);
}

.comic .seo-block{
    margin-top: 20px;
}
.seo-block h2{ margin:0 0 8px; font-size: 18px; font-weight: 900; }
.seo-block ol{ margin:0 0 12px 18px; }
.badges{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}
.badges span{
    border: 2px solid rgba(17,17,17,0.8);
    background: rgba(255,255,255,0.6);
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 800;
    font-size: 12px;
}

.footer{
    text-align:center;
    padding: 14px 10px 24px;
    color: rgba(17,17,17,0.75);
    font-weight: 700;
    position: relative;
    z-index: 10;
}

.file-info {
    margin-top: 10px;
    padding: 10px;
    background: rgba(242,183,5,0.1);
    border-radius: 8px;
    font-size: 13px;
    color: rgba(17,17,17,0.8);
    font-weight: 600;
}

/* Privacy page styles */
.privacy-content {
    line-height: 1.6;
}

.privacy-content h2 {
    margin: 24px 0 12px;
    font-size: 20px;
    font-weight: 900;
    color: var(--ink);
}

.privacy-content h2:first-of-type {
    margin-top: 0;
}

.privacy-content p {
    margin: 12px 0;
    color: rgba(17,17,17,0.85);
}

.privacy-content ol,
.privacy-content ul {
    margin: 12px 0 12px 18px;
    color: rgba(17,17,17,0.85);
}

.privacy-content li {
    margin: 8px 0;
    line-height: 1.5;
}

.privacy-content strong {
    font-weight: 900;
    color: var(--ink);
}

/* Responsive */
@media (max-width: 980px){
    .hero-grid{ grid-template-columns: 1fr; }
    .comic{ border-right: none; border-bottom: var(--stroke); }
    .title{ font-size: 30px; }
}
/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(17, 17, 17, 0.98);
    color: #fff;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: none;
    border-top: 3px solid #F2B705;
}

.cookie-consent.active {
    display: block;
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-consent-text {
    flex: 1;
    min-width: 250px;
    font-size: 14px;
    line-height: 1.6;
}

.cookie-consent-text a {
    color: #F2B705;
    text-decoration: underline;
}

.cookie-consent-text a:hover {
    text-decoration: none;
}

.cookie-consent-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cookie-consent-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.cookie-consent-btn-accept {
    background: #F2B705;
    color: #111;
}

.cookie-consent-btn-accept:hover {
    background: #e0a704;
    transform: translateY(-1px);
}

.cookie-consent-btn-decline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cookie-consent-btn-decline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 520px){
    .form-grid{ grid-template-columns: 1fr; }
    .title{ font-size: 26px; }
    .topbar{
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-consent-buttons {
        width: 100%;
    }
    .cookie-consent-btn {
        flex: 1;
    }
}
