body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background: #f5f7fa;
    color: #333;
}

#app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #2c3e50;
}

.subtitle {
    font-size: 1rem;
    color: #6c757d;
}

.input-bar {
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

textarea {
    border: none;
    outline: none;
    resize: none;
    font-size: 1rem;
    font-family: inherit;
    padding: 10px;
    border-radius: 8px;
    min-height: 80px;
    background-color: #f9f9f9;
}

.button-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

button[type="submit"] {
    background: #1e88e5;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease-in-out;
}

button[type="submit"]:hover {
    background: #1565c0;
}

button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button[type="submit"]:disabled:hover {
    background: #1e88e5;
}

.file-upload label {
    background: #43a047;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.file-upload input[type="file"] {
    display: none;
}

.file-chip {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-chip #file-name {
    padding-right: 12px;
}

.file-chip button#remove-file {
    background: #e53935;
    border: none;
    color: white;
    font-size: 12px;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

#result-section {
    margin-top: 40px;
}

#result {
    display: none;
    padding-bottom: 20px;
}

.agent-response {
    border-radius: 10px;
    padding: 12px;
    margin: 10px 0;
    background: #ffffff;
    border-left: 6px solid #ccc;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.agent-response:nth-child(even) {
    margin-left: 40px;
}

.agent-response:nth-child(odd) {
    margin-right: 40px;
}

.agent-response[data-agent="FinalDecisionAgent"] {
    border-left-color: #4a148c;
}

.agent-response[data-agent="URLEvaluatorAgent"] {
    border-left-color: #00796b;
}

.agent-response[data-agent="WebFactCheckerAgent"] {
    border-left-color: #1e88e5;
}

.agent-response[data-agent="LanguageAgent"] {
    border-left-color: #ff7043;
}

.agent-response[data-agent="PhrasingAgent"] {
    border-left-color: #fbc02d;
}

.agent-response[data-agent="PoliticalBiasAgent"] {
    border-left-color: #c62828;
}

.agent-header {
    font-weight: bold;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.agent-header-title {
    font-weight: 600;
}

.agent-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
    padding: 2px 6px;
    margin-left: 10px;
    transition: color 0.2s ease;
}

.toggle-btn:hover {
    color: #1e88e5;
}

.agent-body {
    display: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
}

.agent-response.open .agent-body {
    display: block;
}

footer {
    margin-top: auto;
    padding: 20px 0;
    text-align: center;
    color: #aaa;
    font-size: 0.85rem;
}

.status-badge {
    margin-left: 8px;
    font-size: 1.2rem;
    vertical-align: middle;
}

.json-row {
    margin: 6px 0;
    background: #f1f3f5;
    padding: 8px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.95rem;
    word-break: break-word;
}

.json-row a {
    color: #1e88e5;
    text-decoration: underline;
}

.json-row ul {
    margin: 4px 0 0 10px;
    padding-left: 18px;
}

.json-row li {
    margin-bottom: 2px;
}

.final-decision-badge {
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
    font-size: 1rem;
    color: white;
    vertical-align: middle;
    margin-left: 8px;
}

.agent-response.final-decision {
    border-left-color: #4a148c !important;
    background-color: #f8f1ff;
    font-size: 1.05rem;
    font-weight: 500;
    box-shadow: 0 0 0 2px rgba(74, 20, 140, 0.05);
}

.final-decision-badge.real {
    background-color: #2e7d32;
}

.final-decision-badge.fake {
    background-color: #c62828;
}

.status-icon {
    margin-left: 6px;
    font-size: 1rem;
    vertical-align: middle;
}

.model-selection {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.agent-model-pick {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 30px;
}

.agent-model-pick label {
    font-weight: 500;
    min-width: 180px;
}

.agent-model-pick select {
    width: 200px;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    font-family: inherit;
}

#confirm-models {
    margin-top: 14px;
    background: #1565c0;
    color: white;
    font-weight: bold;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

#confirm-models:hover {
    background: #0d47a1;
}

#model-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 247, 250, 0.8);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#model-overlay.hidden {
    display: none;
}

#configure-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
    background: #1565c0;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
}

.agent-model-label {
    font-size: 0.9rem;
    color: #444;
    font-style: italic;
    margin: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    clip: rect(0, 0, 0, 0);
    overflow: hidden;
}

@media screen and (max-width: 768px) {
    #app-container {
        padding: 10px;
        max-width: 100%;
    }

    .agent-model-pick {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .input-bar {
        padding: 12px;
    }

    button[type="submit"], .file-upload label {
        width: 50%;
        text-align: center;
    }

    .agent-response {
        margin: 8px 0 !important;
    }
}

#model-overlay {
    animation: fadeIn 0.25s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

button:focus, select:focus, textarea:focus {
    outline: 2px solid #1e88e5;
    outline-offset: 2px;
}

.agent-tooltip {
    position: relative;
    cursor: help;
}

.agent-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    top: 120%;
    width: 280px;
    background: #ffffe0;
    color: #000;
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 20;
    white-space: pre-line;
}

.agent-tooltip:hover::after {
    opacity: 1;
    transform: translateY(0);
}

#howto-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1001;
    background: #00796b;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#howto-overlay.hidden {
    display: none;
}

#howto-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 247, 250, 0.85);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease-in;
}

#progress-sidebar {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 280px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    padding: 14px;
    z-index: 1100;
}

#progress-sidebar.hidden {
    display: none;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 8px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

#progress-toggle {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    margin-left: 12px;
}

.progress-content {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f1f3f5;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #1e88e5;
    border-radius: 999px;
    transition: width 0.25s ease-in-out;
}

.progress-percent {
    text-align: right;
    font-size: 0.9rem;
    color: #555;
    margin-top: 6px;
    margin-bottom: 8px;
}

.progress-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
}

.progress-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border: 1px solid #eceff1;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.95rem;
}

.progress-item .left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #d0d7de;
    background: #ffffff;
    color: #555;
}

.progress-status {
    min-width: 86px;
    text-align: right;
    font-weight: 600;
    color: #607d8b;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.spinner {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #cfd8dc;
    border-top-color: #1e88e5;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.progress-status.done {
    color: #2e7d32;
}

.progress-status.done::before {
    content: "✔";
    font-weight: 700;
}

.progress-status.pending::before {
    content: "";
}

.progress-hint {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #6c757d;
}

#progress-sidebar.minimised .progress-content {
    display: none;
}

#progress-sidebar.minimised {
    width: auto;
    padding: 10px 14px;
    cursor: pointer;
}

#progress-sidebar.minimised .progress-header span {
    font-size: 0.9rem;
}

.progress-mini {
    display: none;
    width: 100%;
    height: 4px;
    background: #f1f3f5;
    border-radius: 999px;
    overflow: hidden;
}

.progress-mini-fill {
    height: 100%;
    width: 0%;
    background: #1e88e5;
    border-radius: 999px;
    transition: width 0.25s ease-in-out;
}

#progress-sidebar.minimised .progress-mini {
    display: block;
}

@media (max-width: 860px) {
    #progress-sidebar {
        display: none;
    }
}

.skeleton-card {
    border-radius: 10px;
    padding: 12px;
    margin: 10px 0;
    background: #ffffff;
    border-left: 6px solid #e0e0e0;
}

.skeleton-row {
    height: 12px;
    border-radius: 8px;
    margin: 10px 0;
    overflow: hidden;
    position: relative;
    background: #eceff1;
}

.skeleton-row.short {
    width: 40%;
}

.skeleton-row.med {
    width: 70%;
}

.skeleton-row.long {
    width: 100%;
}

.skeleton-shimmer::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .6) 50%, rgba(255, 255, 255, 0) 100%);
    animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}
