/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Tijelo da footer lijepo sjedne na dno */
html, body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #f5f7ff 0, #e4e7f2 40%, #d7dae8 100%);
    color: #111827;
    display: flex;
    justify-content: stretch;
}

/* Glavna "kutija" */
.page {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 24px 32px;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1440px) {
    .page {
        max-width: 1400px;
    }
}

/* ==========================
      HEADER + LOGOTIPI
   ========================== */
.topbar {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    justify-content: center;
    position: relative;
}

/* LOGOTIPI – lijevo (desktop) */
.logos-blend {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 32px;
    width: auto;
    display: block;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.logo-link:hover .logo-img {
    transform: translateY(-1px);
    opacity: 0.95;
}

/* BRAND (naslov) – u sredini */
.brand {
    text-align: center;
}

.brand-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f2937;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9),
                 0 -1px 0 rgba(148, 163, 184, 0.4);
    cursor: pointer;
    transition: color 0.15s ease-out, text-shadow 0.15s ease-out;
}

.brand-title:hover {
    color: #1f3fbf;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 1),
                 0 -1px 0 rgba(107, 114, 128, 0.6);
}

.brand-subtitle {
    display: block;
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 4px;
}

/* JEZIČNI IZBORNIK – desno (desktop) */
.lang-switch {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.9rem;
}

.lang-link,
.lang-current {
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 6px 12px;
    text-decoration: none;
    letter-spacing: 0.03em;
}

.lang-current {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #f9fafb;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.35);
}

.lang-link {
    color: #4b5563;
    border: 1px solid transparent;
    transition: all 0.15s ease-out;
}

.lang-link:hover {
    border-color: #9ca3af;
    background-color: rgba(156, 163, 175, 0.15);
    color: #111827;
}

/* --- RESPONSIVE HEADER --- */
@media (max-width: 900px) {
    .topbar {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .logos-blend,
    .lang-switch {
        position: static;
        transform: none;
    }

    .logos-blend {
        order: 1;
        margin-bottom: 4px;
    }

    .brand {
        order: 2;
        text-align: center;
    }

    .lang-switch {
        order: 3;
        margin-top: 4px;
    }
}

/* ==========================
            MAIN
   ========================== */
.content {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}

@media (max-width: 800px) {
    .content {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Cards */
.card {
    background: rgba(249, 250, 251, 0.96);
    border-radius: 18px;
    padding: 20px 22px;
    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.12),
        0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(10px);
    height: 100%;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #111827;
}

.card-text {
    font-size: 0.95rem;
    color: #4b5563;
    margin-bottom: 18px;
}

/* ==========================
        FORM ELEMENTI
   ========================== */
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
}

/* Modern select */
.form-row select {
    font-size: 0.9rem;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid #c7d2fe;
    background-color: #ffffff;
    color: #111827;
    outline: none;
    transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #4f46e5 50%),
        linear-gradient(135deg, #4f46e5 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 32px;

    max-width: 320px;
    width: 100%;
}

.form-row select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.35);
}

/* CHECKBOXI */
.output-options {
    margin-top: 8px;
    gap: 8px;
}

.chk {
    font-size: 0.9rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 8px;
    transition: background-color 0.15s ease-out;
}

.chk:hover {
    background-color: rgba(129, 140, 248, 0.12);
}

.chk input[type="checkbox"] {
    height: 16px;
    width: 16px;
    border-radius: 4px;
    cursor: pointer;
}

/* BUTTON */
.form-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    border: none;
    border-radius: 999px;
    padding: 9px 18px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.4);
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, filter 0.12s ease-out;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 30px rgba(79, 70, 229, 0.45);
    filter: brightness(1.03);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 7px 14px rgba(79, 70, 229, 0.35);
}

/* File input */
.file-input {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.file-btn {
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #f9fafb;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 9px 18px rgba(79, 70, 229, 0.35);
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, filter 0.12s ease-out;
}

.file-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(79, 70, 229, 0.45);
}

.file-label {
    font-size: 0.88rem;
    color: #6b7280;
    max-width: 260px;
    word-break: break-all;
}

.file-hidden {
    display: none;
}

/* ==========================
     RESULTS (DESNO)
   ========================== */
.results-empty {
    font-size: 0.9rem;
    color: #9ca3af;
}

.results-box {
    padding: 12px 14px;
    border-radius: 12px;
    background-color: #eef2ff;
    border: 1px solid #c7d2fe;
    font-size: 0.9rem;
    color: #1e3a8a;
}

.result-summary {
    margin-bottom: 8px;
    color: #374151;
}

.result-item {
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px dashed rgba(148, 163, 184, 0.7);
}

.result-item-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.results-link {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
}

.results-link:hover {
    text-decoration: underline;
}

/* ==========================
          FOOTER
   ========================== */
.footer {
    margin-top: 28px;
    font-size: 0.8rem;
    color: #6b7280;
    text-align: center;
    line-height: 1.5;
}

/* ==========================
         OVERLAY
   ========================== */
.processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.processing-overlay.visible {
    display: flex;
}

.processing-card {
    background: rgba(248, 250, 252, 0.98);
    border-radius: 18px;
    padding: 20px 24px;
    max-width: 420px;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.processing-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.processing-text {
    font-size: 0.9rem;
    margin-bottom: 14px;
    color: #4b5563;
}

.loading-bar {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.loading-bar-inner {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 40%;
    border-radius: 999px;
    background: linear-gradient(90deg, #4f46e5, #6366f1);
    animation: loading-bar 1.2s ease-in-out infinite;
}

@keyframes loading-bar {
    0% { transform: translateX(-60%) scaleX(0.3); }
    50% { transform: translateX(0) scaleX(1); }
    100% { transform: translateX(60%) scaleX(0.3); }
}
