/* =========================
   Global & Layout
   ========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 🛑 FIX: Prevent giant images exploding to full screen */
img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

html,
body {
    height: 100%;
    background: #050505;
    color: #f5f5f5;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    justify-content: center;
    padding: 0 16px;
}

.app-shell {
    width: 100%;
    max-width: 860px;
    padding: 32px 0 80px 0; /* footer spacing */
}

/* =========================
   THEME TOGGLE — top right
   ========================= */

.theme-toggle-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-toggle-btn:hover {
    opacity: 1;
    transform: scale(1.07);
}

#theme-icon {
    width: 28px;
    height: 28px;
}

/* =========================
   Cards
   ========================= */

.card {
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    padding: 24px 26px;
    margin-bottom: 28px;
    backdrop-filter: blur(10px);

    width: 100%;
    max-width: 100%;
    overflow: hidden; /* safe */
}

/* =========================
   Upload / Drop Zone
   ========================= */

.upload-card {
    text-align: center;
}

.drop-zone {
    cursor: pointer;
    border-radius: 20px;
    transition:
        border-color 0.25s ease,
        background 0.25s ease,
        transform 0.25s ease;
}

.drop-zone:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-1px);
}

.drop-zone.is-dragging {
    border-color: #8ed0ff;
    background: rgba(142, 208, 255, 0.05);
}

.drop-icon {
    width: 56px;
    opacity: 0.85;
    margin-bottom: 16px;
}

.headline {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 4px;
}

.subheadline {
    font-size: 14px;
    color: #c5c5c5;
    margin-bottom: 18px;
}

.visually-hidden {
    display: none;
}

.upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 30px;
    border-radius: 999px;
    border: none;
    background: #5c5c5c;
    color: #f8f8f8;
    font-size: 15px;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.upload-button:hover {
    background: #707070;
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
}

/* =========================
   Selected File Info
   ========================= */

.file-info-card {
    display: none;
    align-items: center;
    justify-content: space-between;
}

.file-info-card.visible {
    display: flex;
}

.file-info-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.file-icon {
    width: 36px;
}

.file-meta {
    text-align: left;
}

.file-name {
    font-size: 18px;
    font-weight: 600;
}

.file-size,
.file-type {
    font-size: 13px;
    color: #b9b9b9;
}

.file-remove-btn {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 6px;
    transition: color 0.2s ease;
}

.file-remove-btn:hover {
    color: #fff;
}

/* =========================
   Convert Selector
   ========================= */

.convert-label {
    display: block;
    text-align: left;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}

.select-wrapper {
    border-radius: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 14px;
    transition:
        border-color 0.25s ease,
        background 0.25s ease,
        opacity 0.25s ease;
}

.select-wrapper.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.format-select {
    width: 100%;
    border: none;
    background: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.format-select option {
    background: #fff;
    color: #000;
}

.convert-hint {
    margin-top: 8px;
    font-size: 13px;
    color: #a6a6a6;
}

/* =========================
   Progress
   ========================= */

.progress-section {
    margin-top: 14px;
    margin-bottom: 24px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #fff;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    color: #d3d3d3;
    margin-top: 6px;
}

/* =========================
   Actions (Buttons)
   ========================= */

.actions-section {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
}

.btn {
    border-radius: 999px;
    border: none;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn-primary {
    flex: 1;
    max-width: 100%;
    padding: 16px 24px;
    background: #fff;
    color: #000;
}

.btn-primary:hover:not([disabled]) {
    background: #ececec;
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.btn-primary[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.download-icon {
    width: 18px;
}

.btn-secondary {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: #1b7cff;
    color: #fff;
    font-size: 22px;
}

.btn-secondary:hover {
    background: #2b8bff;
    transform: translateY(-1px);
}

/* =========================
   Footer
   ========================= */

.app-footer {
    margin-top: 55px;
    padding-bottom: 40px;
    text-align: center;
    font-size: 13px;
    color: #a0a0a0;
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 640px) {
    .app-shell {
        padding-top: 24px;
        padding-bottom: 80px;
    }

    .card {
        padding: 20px 16px;
        margin-bottom: 22px;
    }

    .headline {
        font-size: 24px;
    }

    .btn-primary {
        font-size: 16px;
        padding: 14px;
    }

    .btn-secondary {
        width: 40px;
        height: 40px;
    }

    .theme-toggle-btn {
        top: 16px;
        right: 16px;
    }
}

/* =======================================================
   LIGHT MODE OVERRIDES
   ======================================================= */

html.light,
html.light body {
    background: #f5f5f5 !important;
    color: #111 !important;
}

html.light .card {
    border: 1px dashed rgba(0, 0, 0, 0.12) !important;
    background: rgba(0, 0, 0, 0.03) !important;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.1) !important;
}

html.light .drop-zone:hover {
    border-color: rgba(0, 0, 0, 0.35) !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

html.light .format-select {
    color: #000 !important;
}

html.light .progress-bar {
    background: rgba(0, 0, 0, 0.08) !important;
}

html.light .progress-fill {
    background: #000 !important;
}

html.light .btn-primary {
    background: #000 !important;
    color: #fff !important;
}

html.light .btn-primary:hover:not([disabled]) {
    background: #222 !important;
}

html.light .btn-secondary {
    background: #0078ff !important;
}
/* =========================
   HS LOGO — FIX SIZE & CENTER
   ========================= */

.hs-logo {
    width: 120px;          /* adjust if you want smaller/larger */
    height: auto;
    display: block;
    margin: 0 auto 32px;   /* centers it and adds spacing below */
    opacity: 0.95;
}
