/* Import czcionki z Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');

/* --- Zmienne kolorystyczne i globalne ustawienia --- */
:root {
    --kolor-tla: #f4f7f9;
    --kolor-karty: #ffffff;
    --kolor-tekstu: #34495e;
    --kolor-naglowka: #2c3e50;
    --kolor-glowny: #3498db;
    --kolor-glowny-hover: #2980b9;
    --kolor-sukces: #2ecc71;
    --kolor-blad: #e74c3c;
    --kolor-ostrzezenie: #f39c12;
    --kolor-ramki: #e1e8ed;
    --cien-karty: 0 4px 15px rgba(0, 0, 0, 0.07);
}

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--kolor-tla);
    color: var(--kolor-tekstu);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1,
h2 {
    color: var(--kolor-naglowka);
    border-bottom: 2px solid var(--kolor-ramki);
    padding-bottom: 10px;
}

a {
    color: var(--kolor-glowny);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--kolor-glowny-hover);
    text-decoration: underline;
}

/* --- Nagłówek i nawigacja --- */
.header {
    background-color: var(--kolor-karty);
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: var(--cien-karty);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--kolor-naglowka);
}

/* --- Formularze i Przyciski --- */
button,
input[type="submit"] {
    background-color: var(--kolor-glowny);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

button:hover,
input[type="submit"]:hover {
    background-color: var(--kolor-glowny-hover);
    transform: translateY(-2px);
}

input[type="text"],
input[type="password"],
select {
    padding: 10px;
    border: 1px solid var(--kolor-ramki);
    border-radius: 5px;
    font-size: 15px;
    margin: 0 5px;
}

.card {
    background-color: var(--kolor-karty);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--cien-karty);
    margin-bottom: 30px;
}

/* --- Historia Analiz - Styl Kart --- */
.analysis-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.analysis-card {
    background-color: var(--kolor-karty);
    border-radius: 8px;
    box-shadow: var(--cien-karty);
    padding: 0;
    transition: box-shadow 0.3s;
    border-left: 5px solid var(--kolor-ramki);
}

.analysis-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.analysis-title {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--kolor-naglowka);
    display: flex;
    align-items: center;
}

.analysis-meta {
    font-size: 0.9em;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    gap: 15px;
    white-space: nowrap;
}

.analysis-status {
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.8em;
    color: white;
}

.status-zakończona {
    background-color: var(--kolor-sukces);
}

.status-błąd,
.status-błąd-api,
.status-błąd-konwersji {
    background-color: var(--kolor-blad);
}

.analysis-summary {
    background-color: #f8f9fa;
    border: 1px solid var(--kolor-ramki);
    padding: 15px;
    border-radius: 5px;
    white-space: pre-wrap;
    font-size: 0.95em;
    line-height: 1.7;
    max-height: 400px;
    overflow-y: auto;
}

.analysis-summary strong {
    color: var(--kolor-naglowka);
}

.analysis-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--kolor-ramki);
    display: flex;
    gap: 10px;
    align-items: center;
}

.analysis-actions a {
    font-size: 0.9em;
}

.analysis-actions button,
.analysis-actions select {
    font-size: 0.9em;
    padding: 8px 12px;
}

.accordion-trigger {
    cursor: pointer;
    transition: background-color 0.2s;
}

.accordion-trigger:hover {
    background-color: #f9fafb;
}

.analysis-content {
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out;
    max-height: 2000px;
    padding: 0 20px 20px 20px;
}

.analysis-content.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* --- Animacja ładowania --- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
    text-align: center;
}

.loading-box {
    background-color: var(--kolor-naglowka);
    padding: 40px 60px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.loading-box h2 {
    color: white;
    border: none;
    margin-top: 20px;
}

.spinner {
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top: 8px solid var(--kolor-glowny);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- STYLE DLA STATUSÓW BIZNESOWYCH --- */
.status-startujemy {
    border-left-color: var(--kolor-sukces) !important;
}

.status-nie-startujemy {
    border-left-color: var(--kolor-blad) !important;
}

.status-do-przemyslenia {
    border-left-color: var(--kolor-ostrzezenie) !important;
}


/* NOWY STYL DLA OKNA NOTATKI */
.analysis-note {
    background-color: #fffbe6;
    /* Żółtawe tło */
    border: 1px solid #ffe58f;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.analysis-note p {
    margin: 5px 0 0 0;
}