/**
 * Tablica Ogłoszeń - Style CSS
 * Version: 1.1.0
 */

/* Widget - kontener główny */
.tablica-ogloszen-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Formularz */
.to-formularz {
    margin-bottom: 25px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.to-form-group {
    margin-bottom: 15px;
}

.to-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.to-form-group input[type="text"],
.to-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.to-form-group input[type="text"]:focus,
.to-form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.to-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Licznik znaków */
.to-licznik {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    text-align: right;
}

.to-licznik.to-limit {
    color: #dc3232;
    font-weight: 600;
}

/* Przycisk submit */
.to-submit {
    width: 100%;
    padding: 12px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.to-submit:hover {
    background: #005a87;
}

.to-submit:active {
    transform: translateY(1px);
}

.to-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Komunikaty */
.to-komunikat {
    margin: 15px 0;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.to-komunikat.sukces {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.to-komunikat.blad {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Lista ogłoszeń */
.to-lista {
    margin-top: 20px;
}

.to-lista h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 8px;
}

.to-ogloszenia {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Pojedyncze ogłoszenie */
.to-ogloszenie {
    padding: 12px;
    background: #f9f9f9;
    border-left: 3px solid #0073aa;
    border-radius: 4px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.to-ogloszenie:hover {
    background: #f5f5f5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.to-ogl-naglowek {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 5px;
}

.to-ogl-naglowek strong {
    color: #0073aa;
    font-size: 14px;
}

.to-ogl-data {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.to-ogl-tresc {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    word-wrap: break-word;
}

.to-brak {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

/* Responsive */
@media (max-width: 480px) {
    .tablica-ogloszen-widget {
        padding: 10px;
    }

    .to-formularz {
        padding: 10px;
    }

    .to-ogl-naglowek {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Animacja ładowania */
.to-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.to-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: to-spin 0.8s linear infinite;
}

@keyframes to-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
