/* ============================================================
   МОБІЛЬНА АДАПТАЦІЯ — festgroup.org
   Підключити через wp_enqueue_style в festgroup-applications.php
   ============================================================ */

/* ------------------------------------------------------------
   Загальні виправлення кабінету
   ------------------------------------------------------------ */

/* Кнопка "Вийти" — не переносити текст */
.fg-cabinet-header .fg-btn {
    white-space: nowrap !important;
    width: auto !important;
    flex-shrink: 0;
}

/* Шапка кабінету на мобільному */
@media (max-width: 600px) {
    .fg-cabinet {
        padding: 12px;
    }

    .fg-cabinet-header {
        gap: 8px;
        flex-wrap: nowrap;
        align-items: flex-start;
    }

    .fg-cabinet-header h2 {
        font-size: 18px;
        line-height: 1.3;
    }

    /* Навігація кабінету — рівна ширина кнопок */
    .fg-cabinet-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .fg-cabinet-nav a {
        text-align: center;
        padding: 10px 8px;
        font-size: 13px;
    }

    /* Статистика на головній */
    .fg-dashboard-stats {
        grid-template-columns: 1fr 1fr;
        display: grid;
    }

    .fg-stat-card {
        min-width: unset;
    }

    .fg-stat-number {
        font-size: 32px;
    }
}


/* ------------------------------------------------------------
   Таблиці — картковий вигляд на мобільному
   ------------------------------------------------------------ */
@media (max-width: 600px) {

    /* Ховаємо заголовок таблиці */
    .fg-table thead {
        display: none;
    }

    .fg-table,
    .fg-table tbody,
    .fg-table tr,
    .fg-table td {
        display: block;
        width: 100%;
    }

    /* Кожен рядок — окрема картка */
    .fg-table tr {
        border: 1px solid #ddd;
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 12px;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,.06);
    }

    .fg-table tr:hover td {
        background: transparent;
    }

    .fg-table td {
        border: none;
        padding: 4px 0;
        font-size: 14px;
    }

    /* Кнопки в картці — в рядок */
    .fg-table td:last-child {
        display: flex;
        gap: 8px;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #eee;
    }

    .fg-table td:last-child .fg-btn {
        flex: 1;
        text-align: center;
        white-space: nowrap !important;
        width: auto !important;
    }

    /* Таблиця дітей — показуємо мітки */
    .fg-table td[data-label]:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #666;
        font-size: 12px;
    }
}


/* ------------------------------------------------------------
   Форма додавання колективу/дитини
   ------------------------------------------------------------ */
@media (max-width: 600px) {
    .fg-form-inline {
        padding: 14px;
    }

    .fg-form-row-double {
        grid-template-columns: 1fr !important;
    }

    .fg-age-minmax {
        grid-template-columns: 1fr 1fr;
    }
}


/* ------------------------------------------------------------
   Wizard подачі заявки
   ------------------------------------------------------------ */
@media (max-width: 600px) {

    /* Прогрес — менший розмір */
    .fg-wizard-progress {
        gap: 0;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .fg-wizard-step-num {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .fg-wizard-step-label {
        font-size: 10px;
    }

    .fg-wizard-step-line {
        min-width: 12px;
        margin: 0 2px;
        margin-bottom: 14px;
    }

    /* Картки конкурсів */
    .fg-competition-select {
        padding: 12px;
    }

    .fg-competition-select-title {
        font-size: 15px;
    }

    .fg-competition-select-meta {
        font-size: 12px;
    }

    /* Вибір дітей — одна колонка */
    .fg-children-select {
        grid-template-columns: 1fr;
    }

    .fg-child-checkbox {
        padding: 12px;
        font-size: 15px;
    }

    /* Стилі танцю */
    .fg-style-select {
        grid-template-columns: 1fr 1fr;
    }

    /* Кнопки wizard */
    .fg-wizard-nav .fg-btn {
        padding: 12px 16px !important;
        font-size: 15px;
    }

    /* Форма деталей */
    .fg-wizard-form .fg-form-row input,
    .fg-wizard-form .fg-form-row select,
    .fg-wizard-form .fg-form-row textarea {
        font-size: 16px; /* важливо — менше 16px викликає zoom на iOS */
    }

    /* Кнопки "З точки / З куліси" */
    .fg-child-checkbox[style*="flex:1"] {
        padding: 14px 8px;
        font-size: 14px;
    }
}


/* ------------------------------------------------------------
   Таблиця заявок хореографа
   ------------------------------------------------------------ */
@media (max-width: 600px) {
    .fg-application-card {
        flex-direction: column;
        gap: 10px;
    }

    .fg-application-card-actions {
        width: 100%;
    }

    .fg-application-card-actions .fg-btn {
        display: block;
        width: 100% !important;
        text-align: center;
    }

    .fg-application-card-meta {
        gap: 6px;
    }
}


/* ------------------------------------------------------------
   Форма реєстрації і входу
   ------------------------------------------------------------ */
@media (max-width: 600px) {
    .fg-form-wrap {
        margin: 16px;
        padding: 20px;
        border-radius: 8px;
    }

    .fg-form-wrap h2 {
        font-size: 20px;
    }

    /* Важливо для iOS — без zoom при фокусі на input */
    .fg-form-row input[type="text"],
    .fg-form-row input[type="email"],
    .fg-form-row input[type="password"],
    .fg-form-row input[type="tel"] {
        font-size: 16px !important;
    }
}
