/**
 * Global Styles – Assistenzboerse DGS
 *
 * Shared container base and utility classes
 * used across all shortcodes. No shortcode-specific rules here.
 *
 * @package assistenzboerse-dgs
 */

/* ===================================================================
    Container base
    Applied to the primary card container of each shortcode.
    =================================================================== */

.azb-dgs-table-wrap {
    background: #ffffff;
    border-radius: 15px;
    padding: 1.5rem;
    box-sizing: border-box;
    margin-top: 1rem;
    overflow-x: auto;
}

/* --- Table cell borders (shared by all shortcodes using azb-dgs-table-wrap) --- */

.azb-dgs-table-wrap th,
.azb-dgs-table-wrap td {
    border: 0;
    border-right: 1px solid var(--azb-dgs-border-color);
    border-bottom: 1px solid var(--azb-dgs-border-color);
    background: transparent;
    vertical-align: top;
}

.azb-dgs-table-wrap th:last-child,
.azb-dgs-table-wrap td:last-child {
    border-right: 0;
}

.azb-dgs-table-wrap tbody tr:last-child td {
    border-bottom: 0;
}

/* --- Table base reset --- */

.azb-dgs-list-table {
    margin-bottom: 0 !important;
}

/* ===================================================================
   Global form input styles
   =================================================================== */
input[type="text"], input[type="number"],
input[type="text"], input[type="email"],
input[type="password"],
input[type="date"],
input[type="tel"],
select, textarea {
    color: var(--azb-dgs-font-color);
    font-size: 18px;
    width: 100%;
    padding: 15px;
    border: none !important;
    border-radius: 10px;
}

textarea {
    resize: none;
    overflow-y: hidden;
    box-sizing: border-box;
}

/* ===================================================================
   Notification boxes (used by all shortcodes)
   =================================================================== */

.azb-dgs-register-success,
.azb-dgs-register-error,
.azb-dgs-register-logged-in {
    max-width: 860px;
    margin: 0.75rem auto;
    padding: 0.8rem 1rem;
    border-radius: 6px;
}

.azb-dgs-register-success {
    border: 1px solid #00a32a;
    background: #edfaef;
    color: #0a4b21;
}

.azb-dgs-register-error {
    border: 1px solid #d63638;
    background: #fcf0f1;
    color: #8a2424;
}

.azb-dgs-register-logged-in {
    border: 1px solid #2271b1;
    background: #edf6ff;
    color: #1d2327;
}

/* ===================================================================
   Utility classes
   =================================================================== */

/* --- Stack list item (used in listing shortcodes) --- */

.azb-dgs-stack-list-item {
    margin: 0 0 0.25rem;
    line-height: 1.35;
}

/* --- Grid layout (register + profile forms) --- */

.azb-dgs-grid {
    display: grid;
    gap: 0.75rem 1rem;
}

.azb-dgs-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* --- Fieldset (register + profile forms) --- */

.azb-dgs-fieldset {
    margin: 0 0 1rem;
    padding: 1rem;
}

.azb-dgs-fieldset legend {
    padding: 0 0.5rem;
    font-weight: 600;
}

/* --- Note --- */

.azb-dgs-note {
    margin: 0 0 1rem;
}

/* ===================================================================
   Form base – shared by [azb_dgs_register] and [azb_dgs_profile_form]
   Both shortcodes use the .azb-dgs-register-form wrapper class.
   =================================================================== */

.azb-dgs-register-form {
    max-width: 100%;
}

.azb-dgs-register-form h2 {
    margin: 0 0 0.5rem;
}

.azb-dgs-register-form p {
    margin: 0;
}

.azb-dgs-register-form label {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.azb-dgs-register-form input[type="text"],
.azb-dgs-register-form input[type="email"],
.azb-dgs-register-form input[type="password"],
.azb-dgs-register-form input[type="date"],
.azb-dgs-register-form input[type="tel"],
.azb-dgs-register-form select {
    width: 100%;
    min-height: 42px;
    padding: 0.55rem 0.65rem;
}

.azb-dgs-register-form input[disabled] {
    background: #f6f7f7;
}

.azb-dgs-register-form .azb-dgs-input-invalid {
    border-color: #d63638;
    box-shadow: 0 0 0 1px #d63638;
}

/* --- Inline form helpers --- */

.azb-dgs-inline-label {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.azb-dgs-inline-error {
    display: none;
    margin-top: 0.35rem;
    color: #cc4060;
    font-size: 0.85rem;
}

/* --- Radio groups --- */

.azb-dgs-radio-inline-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
}

.azb-dgs-radio-inline-options label {
    margin: 0;
    font-weight: 400;
}

.azb-dgs-radio-group {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.azb-dgs-radio-group > span {
    font-weight: 600;
}

.azb-dgs-radio-group label {
    margin: 0;
    font-weight: 400;
}

/* --- Info tooltip box --- */

.azb-dgs-tooltip {
    margin: 0.9rem 0 0;
    padding: 0.7rem 0.75rem;
    border-left: 4px solid #2271b1;
    background: #f0f6fc;
    color: #1d2327;
    border-radius: 4px;
}

/* ===================================================================
   Responsive
   =================================================================== */

/* ===================================================================
   Offer / Request form layout
   Shared by [azb_dgs_my_offers] and [azb_dgs_my_requests] form views.
   =================================================================== */

/* --- Section wrapper --- */
.form-abschnitt label {
    font-size: 18px;
    margin-bottom: 5px;
}

.form-abschnitt {
    background-color: white;
    margin-top: 25px;
    margin-bottom: 25px;
    padding: 25px;
    border-radius: 15px;
}

.form-abschnitt input[type="text"] {
    padding: 15px;
}

/* --- Row and column layout --- */
.form-zeile {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    align-items: flex-start;
    flex-wrap: nowrap;
    width: 100%;
    box-sizing: border-box;
}

.form-spalte, .form-spalte-50 {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-width: 0;
    box-sizing: border-box;
}

.form-spalte-50 {
    flex: 0 0 calc(50% - 0.5rem);
}

.form-zeile.form-textarea {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.form-textarea {
    flex-direction: column;
}

/* --- Tile selection group (Bereich / Kategorie / Dienstleistung / Altersgruppen) --- */
/* Max. 4 Kacheln pro Zeile (25% je – 3 Lücken à 0.65rem auf 4 Elemente = ~0.49rem je) */
.azb-dgs-tile-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.azb-dgs-tile-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.3rem;
    cursor: pointer;
    flex: 0 0 calc(25% - 0.5rem);
    box-sizing: border-box;
    text-align: center;
    padding: 0.4rem 0.5rem;
}

.azb-dgs-tile-label input[type="radio"],
.azb-dgs-tile-label input[type="checkbox"] {
    margin: 0;
    width: 1.8rem;
    height: 1.8rem;
    cursor: pointer;
}

.azb-dgs-tile-label span {
    font-size: 0.9rem;
    line-height: 1.3;
}

/* --- Apple-style toggle switch --- */
.azb-dgs-apple-switch {
    background-color: white;
    width: 340px;
    padding: 15px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
    margin-top: 0.35rem;
}

.azb-dgs-apple-switch span {
    font-size: 18px;
}

.azb-dgs-apple-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.azb-dgs-apple-switch-slider {
    display: inline-block;
    position: relative;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
    background: #ccc;
    border-radius: 13px;
    transition: background 0.22s ease;
}

.azb-dgs-apple-switch-slider::after {
    content: '';
    display: block;
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
    transition: left 0.22s ease;
}

.azb-dgs-apple-switch input[type="checkbox"]:checked ~ .azb-dgs-apple-switch-slider {
    background: #b084f5;
}

.azb-dgs-apple-switch input[type="checkbox"]:checked ~ .azb-dgs-apple-switch-slider::after {
    left: 21px;
}

.azb-dgs-switch-label-on {
    display: none;
    color: #1f7a38;
    font-weight: 700;
}

.azb-dgs-switch-label {
    min-width: 10rem;
    display: inline-block;
}

.azb-dgs-switch-label-off {
    display: inline;
    color: #b42318;
    font-weight: 700;
}

.azb-dgs-apple-switch input[type="checkbox"]:checked ~ .azb-dgs-switch-label .azb-dgs-switch-label-on {
    display: inline;
}

.azb-dgs-apple-switch input[type="checkbox"]:checked ~ .azb-dgs-switch-label .azb-dgs-switch-label-off {
    display: none;
}

/* --- Responsive: form columns stack on mobile --- */
@media (max-width: 900px) {
    .azb-dgs-tile-label {
        flex: 0 0 calc(33.33% - 0.45rem);
    }
}

@media (max-width: 600px) {
    .form-zeile {
        flex-wrap: wrap;
    }

    .form-spalte {
        flex: 0 0 100% !important;
    }

    .azb-dgs-tile-label {
        flex: 0 0 calc(50% - 0.35rem);
    }
}

@media (max-width: 767px) {
    .azb-dgs-my-offers,
    .azb-dgs-my-requests,
    .azb-dgs-profile-form {
        padding: 1rem;
    }

    .azb-dgs-grid-2 {
        grid-template-columns: 1fr;
    }
}
