/* ==========================================================
   RESET
========================================================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html,
body{
    font-family:Inter,Segoe UI,Roboto,Arial,sans-serif;
    background:#f4f7fb;
    color:#1f2937;
    line-height:1.6;
}

/* ==========================================================
   PAGE
========================================================== */

.page{
    width:100%;
    max-width:1200px;
    margin:40px auto;
    padding:20px;
}

/* ==========================================================
   HEADER
========================================================== */

.header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:30px;
    flex-wrap:wrap;
    gap:20px;
}

.header h1{
    font-size:34px;
    font-weight:700;
    color:#111827;
}

.header p{
    margin-top:6px;
    color:#6b7280;
}

.status{
    display:flex;
    align-items:center;
    gap:10px;
    background:#ffffff;
    padding:12px 18px;
    border-radius:10px;
    border:1px solid #e5e7eb;
    box-shadow:0 4px 10px rgba(0,0,0,.04);
}

.status-dot{
    width:10px;
    height:10px;
    border-radius:50%;
    background:#16a34a;
}

/* ==========================================================
   CARD
========================================================== */

.card{
    background:#fff;
    border-radius:14px;
    padding:25px;
    margin-bottom:25px;
    border:1px solid #e5e7eb;
    box-shadow:0 10px 30px rgba(0,0,0,.05);
}

.card h2{
    font-size:22px;
    margin-bottom:18px;
    color:#111827;
}

.card h3{
    margin-bottom:12px;
}

.card p{
    color:#4b5563;
}

/* ==========================================================
   HERO
========================================================== */

.hero-card{
    display:flex;
    gap:25px;
    align-items:center;
    background:linear-gradient(135deg,#2563eb,#3b82f6);
    color:#fff;
    padding:35px;
    border-radius:16px;
    margin-bottom:25px;
    box-shadow:0 15px 35px rgba(37,99,235,.25);
}

.hero-card h2{
    color:#fff;
    margin-bottom:12px;
}

.hero-card p{
    color:#f9fafb;
    font-size:18px;
}

.hero-icon{
    width:90px;
    height:90px;
    border-radius:50%;
    background:rgba(255,255,255,.15);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:42px;
}

/* ==========================================================
   TEXTAREA
========================================================== */

textarea{
    width:100%;
    resize:vertical;
    min-height:170px;
    border:1px solid #d1d5db;
    border-radius:10px;
    padding:18px;
    font-size:16px;
    outline:none;
    transition:.25s;
    background:#fafafa;
}

textarea:focus{
    border-color:#2563eb;
    box-shadow:0 0 0 4px rgba(37,99,235,.15);
    background:#fff;
}

/* ==========================================================
   BUTTON
========================================================== */

.actions{
    margin-top:20px;
}

button{
    border:none;
    cursor:pointer;
    transition:.25s;
    border-radius:10px;
}

#interpretBtn{
    background:#2563eb;
    color:#fff;
    padding:14px 28px;
    font-size:16px;
    font-weight:600;
    display:flex;
    align-items:center;
    gap:12px;
}

#interpretBtn:hover{
    background:#1d4ed8;
}

#interpretBtn:disabled{
    opacity:.6;
    cursor:not-allowed;
}

/* ==========================================================
   GRID
========================================================== */

.grid-4{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:20px;
    margin-bottom:25px;
}

.info-card{
    background:#fff;
    border-radius:14px;
    padding:22px;
    border:1px solid #e5e7eb;
    box-shadow:0 8px 18px rgba(0,0,0,.04);
}

.info-card .label{
    color:#6b7280;
    display:block;
    margin-bottom:12px;
    font-size:14px;
}

.info-card h3{
    font-size:24px;
    color:#111827;
}

/* ==========================================================
   ERROR
========================================================== */

.error{
    border-left:5px solid #dc2626;
    background:#fef2f2;
}

.error h3{
    color:#dc2626;
}

/* ==========================================================
   HIDDEN
========================================================== */

.hidden{
    display:none;
}
/* ==========================================================
   ENTITY LIST
========================================================== */

.entity-list{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
    gap:15px;
}

.entity-item{
    background:#f9fafb;
    border:1px solid #e5e7eb;
    border-radius:10px;
    padding:16px;
    transition:.25s;
}

.entity-item:hover{
    transform:translateY(-2px);
    box-shadow:0 8px 18px rgba(0,0,0,.08);
}

.entity-label{
    font-size:13px;
    font-weight:600;
    color:#6b7280;
    text-transform:uppercase;
    letter-spacing:.5px;
    margin-bottom:8px;
}

.entity-value{
    color:#111827;
    font-size:16px;
    font-weight:500;
    word-break:break-word;
}

/* ==========================================================
   MISSING INFORMATION
========================================================== */

.missing-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.missing-item{
    display:flex;
    align-items:center;
    gap:12px;
    padding:14px 18px;
    border-radius:10px;
    background:#fff7ed;
    border-left:5px solid #f59e0b;
}

.missing-icon{
    font-size:20px;
}

.missing-text{
    font-weight:500;
    color:#92400e;
}

/* ==========================================================
   EMPTY STATE
========================================================== */

.empty-state{
    text-align:center;
    padding:35px;
    border:2px dashed #d1d5db;
    border-radius:12px;
}

.empty-icon{
    font-size:42px;
    color:#16a34a;
    margin-bottom:12px;
}

.empty-text{
    color:#6b7280;
}

/* ==========================================================
   DEVELOPER
========================================================== */

details{
    width:100%;
}

summary{
    cursor:pointer;
    font-size:18px;
    font-weight:600;
    user-select:none;
    margin-bottom:20px;
}

summary:hover{
    color:#2563eb;
}

.developer{
    margin-top:20px;
}

.developer-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:20px;
    margin-bottom:25px;
}

.developer-grid label{
    display:block;
    color:#6b7280;
    margin-bottom:6px;
    font-size:13px;
    text-transform:uppercase;
    letter-spacing:.4px;
}

.developer-grid div div{
    font-size:17px;
    font-weight:600;
    color:#111827;
}

/* ==========================================================
   RAW JSON
========================================================== */

.json-toolbar{
    display:flex;
    justify-content:flex-end;
    margin-bottom:12px;
}

#copyJson{
    background:#111827;
    color:#fff;
    padding:10px 18px;
    border-radius:8px;
    font-size:14px;
}

#copyJson:hover{
    background:#000;
}

#rawJson{
    background:#111827;
    color:#22c55e;
    padding:20px;
    border-radius:12px;
    overflow:auto;
    max-height:450px;
    font-size:13px;
    line-height:1.6;
    white-space:pre-wrap;
}

/* ==========================================================
   LOADER
========================================================== */

.loader{
    width:18px;
    height:18px;
    border:3px solid rgba(255,255,255,.3);
    border-top:3px solid #fff;
    border-radius:50%;
    animation:spin .8s linear infinite;
}

@keyframes spin{

    from{
        transform:rotate(0deg);
    }

    to{
        transform:rotate(360deg);
    }

}

/* ==========================================================
   FADE
========================================================== */

#resultContainer{
    animation:fadeUp .4s ease;
}

@keyframes fadeUp{

    from{
        opacity:0;
        transform:translateY(15px);
    }

    to{
        opacity:1;
        transform:translateY(0);
    }

}

/* ==========================================================
   FOOTER
========================================================== */

.footer{
    margin-top:50px;
    padding:25px 0;
    text-align:center;
    color:#6b7280;
    font-size:14px;
    border-top:1px solid #e5e7eb;
}

.footer div:first-child{
    font-weight:600;
    margin-bottom:5px;
}

/* ==========================================================
   SCROLLBAR
========================================================== */

::-webkit-scrollbar{
    width:10px;
    height:10px;
}

::-webkit-scrollbar-thumb{
    background:#cbd5e1;
    border-radius:10px;
}

::-webkit-scrollbar-track{
    background:#f8fafc;
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media(max-width:992px){

    .grid-4{
        grid-template-columns:repeat(2,1fr);
    }

    .developer-grid{
        grid-template-columns:1fr;
    }

    .hero-card{
        flex-direction:column;
        text-align:center;
    }

}

@media(max-width:768px){

    .page{
        padding:15px;
    }

    .header{
        flex-direction:column;
        align-items:flex-start;
    }

    .grid-4{
        grid-template-columns:1fr;
    }

    .entity-list{
        grid-template-columns:1fr;
    }

    .hero-card{
        padding:25px;
    }

    .hero-icon{
        width:70px;
        height:70px;
        font-size:32px;
    }

    .header h1{
        font-size:28px;
    }

    .card{
        padding:20px;
    }

    #interpretBtn{
        width:100%;
        justify-content:center;
    }

}

@media(max-width:480px){

    .page{
        margin:20px auto;
    }

    .header h1{
        font-size:24px;
    }

    .hero-card p{
        font-size:16px;
    }

    textarea{
        min-height:140px;
    }

}