/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */
/* Stylizacja karty Vouchera */
.voucher-search-form {
    margin-bottom: 30px;
    max-width: 500px;
}

.voucher-search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.g-recaptcha {
    margin: 10px 0;
}
.voucher-error {
    color: #d9534f;
    font-weight: bold;
    margin-top: 10px;
}

.search-input-group {
    display: flex;
    gap: 10px;
}

.search-input-group input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.search-input-group button {
    padding: 12px 25px;
    background-color: #596b4c;/*#0073aa;*/ /* Kolor WordPress */
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.search-input-group button:hover {
    background-color: #005177;
}

/* Prosta animacja pojawiania się wyniku */
.animated-fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .search-input-group { flex-direction: column; }
}

/* Overlay - tło */
.voucher-modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Okno modala */
.voucher-modal-content {
    background-color: #fff;
    border-radius: 12px;
    position: relative;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideUp 0.3s ease-out;
}

/* Przycisk zamknięcia */
.voucher-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.voucher-modal-close:hover { color: #333; }

/* Body modala */
.voucher-modal-body {
    padding: 10px;
}

/* Animacja */
@keyframes modalSlideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* RWD */
@media (max-width: 480px) {
    .voucher-modal-content {
        margin-top: auto;
        border-radius: 20px 20px 0 0;
    }
}


/* Kontener tabeli */
.voucher-history-wrapper {
    margin-top: 20px;
    font-size: 14px;
}

/* Główna tabela z ramką zewnętrzną */
.voucher-table {
    width: 100%;
    border-collapse: collapse; /* Łączy podwójne linie w jedną */
    margin: 10px 0;
    background: #fff;
    border: 1px solid #ccc; /* Grubsza ramka zewnętrzna */
    border-radius: 4px; /* Zaokrąglenie rogów (opcjonalne) */
    overflow: hidden; /* Aby zaokrąglenie działało na rogach komórek */
}

/* Ramki komórek nagłówka */
.voucher-table th {
    background-color: #f1f1f1;
    color: #333;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 12px;
    padding: 12px 10px;
    border: 1px solid #ccc; /* Ramka wokół każdej komórki nagłówka */
}

/* Ramki komórek danych */
.voucher-table td {
    padding: 10px;
    border: 1px solid #ddd; /* Cieńsza ramka dla zawartości */
    vertical-align: middle;
}

/* Efekt "zebry" dla lepszej czytelności */
.voucher-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

/* Wyróżnienie Lp */
.voucher-table td:first-child {
    text-align: center;
    background: #f9f9f9;
    font-weight: bold;
    width: 40px;
}

/* RWD - Dostosowanie ramek na Mobile */
@media screen and (max-width: 600px) {
    .voucher-table, .voucher-table td {
        border: 1px solid #ccc; /* Zachowujemy ramki w widoku kartowym */
    }
    .voucher-table tr {
        margin-bottom: 15px;
        border: 2px solid #bbb; /* Wyraźniejsze oddzielenie kart na mobile */
    }
}


/* Overlay - tło */
.voucher-modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    align-items: center; /* Centrowanie w pionie */
    justify-content: center; /* Centrowanie w poziomie */
    padding: 20px;
}

/* Okno modala */
.voucher-modal-content {
    background-color: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 700px; /* Zwiększone, aby tabela wyglądała lepiej */
    max-height: 90vh; /* Maksymalnie 90% wysokości ekranu */
    display: flex;
    flex-direction: column; /* Układ pionowy: nagłówek -> body */
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: modalSlideUp 0.3s ease-out;
    position: relative;
}

/* Przycisk zamknięcia - teraz "pływa" nad treścią lub jest w nagłówku */
.voucher-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 10;
}

/* Body modala - TU DODAJEMY PRZEWIJANIE */
.voucher-modal-body {
    padding: 30px 20px;
    overflow-y: auto; /* Włącza pionowy pasek przewijania */
    -webkit-overflow-scrolling: touch; /* Płynne przewijanie na iOS */
}

/* Animacja */
@keyframes modalSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* RWD - Pełny ekran na bardzo małych urządzeniach */
@media (max-width: 480px) {
    .voucher-modal-overlay {
        padding: 10px;
    }
    .voucher-modal-content {
        max-height: 95vh;
    }
    .voucher-modal-body {
        padding: 25px 15px;
    }
}

.print-button {
    background: #444;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.print-button:hover {
    background: #000;
}

.voucher-modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.voucher-modal-actions {
    display: block; /* Zmień na block, aby wymusić nową linię */
    width: 100%;
    text-align: right;
    margin-top: 20px; /* Zrób miejsce pod przyciskiem X */
    margin-bottom: 20px;
    position: relative;
    z-index: 5; /* Niżej niż przycisk zamknięcia, ale widoczny */
}

.print-button {
    background: #444;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.print-button:hover {
    background: #000;
}

@media print {
    /* Ukrywamy wszystko poza obszarem druku */
    body * {
        visibility: hidden;
    }
    
    /* Wyświetlamy tylko obszar z wynikami i jego zawartość */
    .voucher-modal-overlay,
    .voucher-modal-content,
    .printable-area,
    .printable-area * {
        visibility: visible;
    }

    /* Usuwamy tło modala i centrowanie dla drukarki */
    .voucher-modal-overlay {
        position: absolute;
        left: 0;
        top: 0;
        background: none !important;
        display: block !important;
    }

    .voucher-modal-content {
        box-shadow: none !important;
        border: none !important;
        max-height: none !important;
    }

    /* Ukrywamy przyciski, których nie chcemy na papierze */
    .no-print, 
    .voucher-modal-close, 
    .print-button,
    .voucher-search-form {
        display: none !important;
    }

    /* Zoptymalizowanie tabeli do druku */
    .voucher-table {
        border: 1px solid #000 !important;
    }
    
    .voucher-table th, .voucher-table td {
        border: 1px solid #000 !important;
        color: #000 !important;
    }
}

/* Stylizacja formularza w modalu */
.voucher-add-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.form-row {
    display: flex;
    flex-direction: column;
}

.form-row label {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #666;
}

.form-row input, .form-row textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.form-row input:disabled {
    background: #f5f5f5;
    color: #999;
}

.v-save-btn {
    background: #28a745;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.v-save-btn:hover {
    background: #218838;
}

.v-success {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
}

.v-error {
    background: #e0c719;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
}

/* RWD */
@media (max-width: 600px) {
    .voucher-modal-content {
        max-width: 95%;
        margin: 10px;
    }
}


