/* =========================================
   Fitpoprawny - Zarządzanie Klientami
   Autor: Aleksander Jasiulewicz
   ========================================= */

/* =========================================
   NAGŁÓWEK I PRZYCISK DODAJ
   ========================================= */

.fitpoprawny_clients_container {
    padding: 20px;
}

.fitpoprawny_clients_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.fitpoprawny_clients_header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--fitpoprawny-dark, #141627);
    margin: 0;
}

.fitpoprawny_clients_btn_add {
    background: var(--fitpoprawny-orange, #e57c34);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(229, 124, 52, 0.3);
}

.fitpoprawny_clients_btn_add:hover {
    background: #d86f2a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 124, 52, 0.4);
}

/* =========================================
   MODAL
   ========================================= */

/* Zablokuj scroll body gdy modal otwarty */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
}

.fitpoprawny_modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    margin: 0;
    overflow-y: auto;
}

.fitpoprawny_modal.show {
    display: flex !important;
}

.fitpoprawny_modal_content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    margin: auto;
    position: relative;
}

.fitpoprawny_modal_content::-webkit-scrollbar {
    width: 8px;
}

.fitpoprawny_modal_content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.fitpoprawny_modal_content::-webkit-scrollbar-thumb {
    background: #e57c34;
    border-radius: 10px;
}

.fitpoprawny_modal_content::-webkit-scrollbar-thumb:hover {
    background: #d66a1f;
}

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

.fitpoprawny_modal_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.fitpoprawny_modal_header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--fitpoprawny-dark, #141627);
    margin: 0;
}

.fitpoprawny_modal_close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.fitpoprawny_modal_close:hover {
    color: var(--fitpoprawny-dark, #141627);
}

/* =========================================
   FORMULARZ
   ========================================= */

.fitpoprawny_client_form {
    padding: 25px;
}

.fitpoprawny_form_row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.fitpoprawny_form_group {
    display: flex;
    flex-direction: column;
}

.fitpoprawny_form_group label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--fitpoprawny-dark, #141627);
    margin-bottom: 8px;
}

.fitpoprawny_form_group input,
.fitpoprawny_form_group select,
.fitpoprawny_form_group textarea {
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.fitpoprawny_form_group input:focus,
.fitpoprawny_form_group select:focus,
.fitpoprawny_form_group textarea:focus {
    border-color: var(--fitpoprawny-orange, #e57c34);
    box-shadow: 0 0 0 3px rgba(229, 124, 52, 0.15);
    outline: none;
}

/* Checkbox label */
.fitpoprawny_checkbox_label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--fitpoprawny-dark, #141627);
}

.fitpoprawny_checkbox_label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--fitpoprawny-orange, #e57c34);
}

.fitpoprawny_field_description {
    font-size: 0.85rem;
    color: #666;
    margin-top: 8px;
}

.fitpoprawny_form_error {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 4px;
    display: block;
    min-height: 18px;
}

.fitpoprawny_form_message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.fitpoprawny_form_message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.fitpoprawny_form_message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* =========================================
   MODAL FOOTER
   ========================================= */

.fitpoprawny_modal_footer {
    display: flex;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    justify-content: flex-end;
}

.fitpoprawny_btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.fitpoprawny_btn_primary {
    background: var(--fitpoprawny-orange, #e57c34);
    color: #fff;
    box-shadow: 0 3px 10px rgba(229, 124, 52, 0.3);
}

.fitpoprawny_btn_primary:hover {
    background: #d86f2a;
    transform: translateY(-2px);
}

.fitpoprawny_btn_secondary {
    background: #f0f0f0;
    color: var(--fitpoprawny-dark, #141627);
}

.fitpoprawny_btn_secondary:hover {
    background: #e5e5e5;
}

/* =========================================
   LISTA KLIENTÓW
   ========================================= */

.fitpoprawny_clients_list {
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    overflow-x: auto;
}

.fitpoprawny_loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--fitpoprawny-orange, #e57c34);
    font-weight: 600;
}

.fitpoprawny_clients_table {
    width: 100%;
    border-collapse: collapse;
}

.fitpoprawny_clients_table thead {
    background: #f8f8f8;
    border-bottom: 2px solid rgba(0, 0, 0, 0.08);
}

.fitpoprawny_clients_table th {
    padding: 15px;
    text-align: left;
    font-weight: 700;
    color: var(--fitpoprawny-dark, #141627);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fitpoprawny_clients_table tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background 0.2s ease;
}

.fitpoprawny_clients_table tbody tr:hover {
    background: #fafafa;
}

.fitpoprawny_clients_table td {
    padding: 15px;
    font-size: 0.95rem;
    color: #333;
}

.fitpoprawny_client_name {
    font-weight: 600;
    color: var(--fitpoprawny-dark, #141627);
}

.fitpoprawny_client_email {
    color: #999;
    font-size: 0.85rem;
}

.fitpoprawny_client_status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.fitpoprawny_status_active {
    background: #d4edda;
    color: #155724;
}

.fitpoprawny_status_inactive {
    background: #f8d7da;
    color: #721c24;
}

.fitpoprawny_status_paused {
    background: #fff3cd;
    color: #856404;
}

/* Badge Konto WP */
.fitpoprawny_wp_badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.fitpoprawny_wp_yes {
    background: #d4edda;
    color: #155724;
}

.fitpoprawny_wp_no {
    background: #f8d7da;
    color: #721c24;
}

.fitpoprawny_client_actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.fitpoprawny_btn_edit,
.fitpoprawny_btn_delete,
.fitpoprawny_btn_create_account {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fitpoprawny_btn_edit {
    background: #e3f2fd;
    color: #1976d2;
}

.fitpoprawny_btn_edit:hover {
    background: #bbdefb;
}

.fitpoprawny_btn_delete {
    background: #ffebee;
    color: #c62828;
}

.fitpoprawny_btn_delete:hover {
    background: #ffcdd2;
}

.fitpoprawny_btn_create_account {
    background: #e8f5e9;
    color: #2e7d32;
}

.fitpoprawny_btn_create_account:hover {
    background: #c8e6c9;
}

/* =========================================
   RESPONSYWNOŚĆ
   ========================================= */

@media (max-width: 768px) {
    .fitpoprawny_form_row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .fitpoprawny_clients_header {
        flex-direction: column;
        align-items: stretch;
    }

    .fitpoprawny_clients_btn_add {
        width: 100%;
        text-align: center;
    }

    .fitpoprawny_clients_table {
        min-width: 600px;
    }

    .fitpoprawny_clients_table th,
    .fitpoprawny_clients_table td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }

    .fitpoprawny_modal {
        padding: 15px !important;
    }

    .fitpoprawny_modal_content {
        max-width: 100%;
        max-height: 95vh;
    }

    .fitpoprawny_clients_list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .fitpoprawny_modal {
        padding: 10px !important;
    }

    .fitpoprawny_modal_content {
        max-height: 98vh;
        border-radius: 12px;
    }

    .fitpoprawny_clients_table {
        font-size: 0.75rem;
        min-width: 500px;
    }

    .fitpoprawny_clients_table th {
        padding: 10px 8px;
        font-size: 0.75rem;
    }

    .fitpoprawny_clients_table td {
        padding: 10px 8px;
        font-size: 0.75rem;
    }

    .fitpoprawny_client_name {
        font-size: 0.8rem;
    }

    .fitpoprawny_client_email {
        font-size: 0.7rem;
    }

    .fitpoprawny_client_status {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .fitpoprawny_btn_edit,
    .fitpoprawny_btn_delete {
        padding: 6px 10px;
        font-size: 0.7rem;
    }

    .fitpoprawny_clients_list {
        border-radius: 0;
        border: none;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }
}
