/* popup.css */

/* Overlay (przyciemnienie tła) */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease; /* Prostsza animacja */
    will-change: opacity; /* Poprawia wydajność animacji */
}

/* Popup "Sprawdź termin" */
#contactPopup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    z-index: 1001;
    width: 90%;
    max-width: 400px;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease; /* Prostsza animacja */
    will-change: opacity; /* Poprawia wydajność animacji */
}

#contactPopup.active {
    opacity: 1; /* Klasa active kontroluje pojawianie się */
}

.popup-overlay.active {
    opacity: 1; /* Klasa active kontroluje pojawianie się overlaya */
}

#contactPopup h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    color: #1a2a44;
}

/* Przycisk zamknięcia */
.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.close-popup:hover {
    color: #e74c3c;
    transform: rotate(90deg);
}

/* Formularz */
#contactForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Grupa formularza */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#contactForm label {
    font-size: 16px;
    font-weight: 600;
    color: #1a2a44;
    margin-bottom: 5px;
}

#contactForm input,
#contactForm select {
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f8f9fa;
    color: #333;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#contactForm input:focus,
#contactForm select:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.3);
    outline: none;
}

#contactForm input::placeholder,
#contactForm select:invalid {
    color: #999;
    font-style: italic;
}

/* Przycisk wysyłania */
#contactForm button[type="submit"] {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 50px;
    transition: background 0.3s ease, transform 0.3s ease;
    width: 150px;
    align-self: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#contactForm button[type="submit"]:hover {
    background: linear-gradient(45deg, #ff8e53, #ff6b6b);
    transform: scale(1.05);
}

/* Animacja pojawiania się popupu (niepotrzebna, bo używamy transition) */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Animacja zamykania popupu (niepotrzebna, bo używamy transition) */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
}

/* Stylizacja przycisku cta-button */
.cta-button {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    color: #ffffff;
    font-size: 1.1em;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: background 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

/* Efekt hover na przycisku */
.cta-button:hover {
    background: linear-gradient(45deg, #ff8e53, #ff6b6b);
    transform: scale(1.05);
}

/* Responsywność */
@media (max-width: 575.98px) {
    #contactPopup {
        width: 95%;
        max-width: 350px;
        padding: 15px;
    }

    #contactPopup h2 {
        font-size: 20px;
    }

    #contactForm label {
        font-size: 14px;
    }

    #contactForm input,
    #contactForm select {
        padding: 10px;
        font-size: 14px;
    }

    #contactForm button[type="submit"] {
        padding: 10px 25px;
        font-size: 14px;
        width: 130px;
    }
}