/**
 * JULIK - Corrections CSS iPhone
 * Fixes pour les pages qui ne s'affichent pas correctement sur iPhone
 */

/* ============================================
   CORRECTIONS PIA PRO - IPHONE
   ============================================ */

/* Grille des tarifs - 1 colonne sur petits écrans */
@media screen and (max-width: 400px) {
    .rates-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 12px;
    }

    .rate-card {
        padding: 14px;
    }

    .rate-amount {
        font-size: 18px;
    }

    .rate-pia {
        font-size: 13px;
    }
}

/* Onglets devises - Stack vertical sur petits écrans */
@media screen and (max-width: 400px) {
    .devise-tabs {
        flex-direction: column;
        gap: 8px;
        padding: 0 12px;
        margin-bottom: 16px;
    }

    .devise-tab {
        width: 100%;
        padding: 12px;
        text-align: center;
    }
}

/* Méthodes de paiement - Stack vertical sur petits écrans */
@media screen and (max-width: 400px) {
    .payment-methods {
        flex-direction: column;
        gap: 10px;
        padding: 0 12px;
    }

    .payment-method {
        padding: 14px;
    }

    .payment-method-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Balance card - Ajuster taille */
@media screen and (max-width: 400px) {
    .pia-pro-balance-card {
        padding: 16px 12px;
        margin: 0 12px 16px;
    }

    .balance-amount {
        font-size: 28px;
    }

    .balance-label {
        font-size: 12px;
    }

    .balance-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* Bouton recharge - Adapter largeur */
@media screen and (max-width: 400px) {
    .btn-recharge {
        width: calc(100% - 24px);
        margin: 0 12px 20px;
        padding: 14px;
        font-size: 15px;
    }
}

/* ============================================
   CORRECTIONS PAGE CONTACT - IPHONE
   ============================================ */

/* Onglets contacts - Réduire padding */
@media screen and (max-width: 400px) {
    .contacts-tabs {
        gap: 6px;
        padding: 0 12px;
        margin-bottom: 16px;
    }

    .contacts-tab {
        padding: 10px 12px;
        font-size: 13px;
    }

    .contacts-tab i {
        font-size: 14px;
    }

    .tab-badge {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
    }
}

/* Cartes d'amis - Optimiser espace */
@media screen and (max-width: 400px) {
    .friend-card {
        padding: 12px;
        margin-bottom: 8px;
    }

    .friend-avatar {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .friend-name {
        font-size: 14px;
    }

    .friend-last-message {
        font-size: 12px;
    }

    .friend-meta {
        min-width: 40px;
    }

    .unread-badge {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
    }
}

/* Actions contacts - Réduire */
@media screen and (max-width: 400px) {
    .contacts-actions {
        gap: 8px;
        padding: 0 12px;
        margin-bottom: 12px;
    }

    .contacts-search-input {
        padding: 10px 10px 10px 36px;
        font-size: 14px;
    }

    .contacts-search-icon {
        left: 10px;
        font-size: 14px;
    }

    .btn-icon {
        width: 40px;
        height: 40px;
    }
}

/* Request cards */
@media screen and (max-width: 400px) {
    .request-card {
        padding: 12px;
    }

    .request-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .request-name {
        font-size: 14px;
    }

    .request-date {
        font-size: 11px;
    }

    .btn-request {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* ============================================
   CORRECTIONS GÉNÉRALES - IPHONE
   ============================================ */

/* Page header - Optimiser espace */
@media screen and (max-width: 400px) {
    .page-header {
        padding: 12px;
        margin-bottom: 16px;
    }

    .page-title {
        font-size: 18px;
    }

    .page-title i {
        font-size: 18px;
    }

    .btn-back {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* Empty state */
@media screen and (max-width: 400px) {
    .empty-state {
        padding: 32px 16px;
    }

    .empty-state i {
        font-size: 48px;
    }

    .empty-state h3 {
        font-size: 16px;
    }

    .empty-state p {
        font-size: 13px;
    }
}

/* Modals - Adapter sur petits écrans */
@media screen and (max-width: 400px) {
    .modal-content {
        max-width: calc(100% - 24px);
        margin: 12px;
        max-height: calc(100vh - 24px);
    }

    .modal-large {
        max-width: calc(100% - 24px);
    }

    .modal-header {
        padding: 16px 12px;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .modal-body {
        padding: 16px 12px;
    }

    .modal-footer {
        padding: 12px;
        gap: 8px;
    }
}

/* Forms - Optimiser */
@media screen and (max-width: 400px) {
    .form-group {
        margin-bottom: 14px;
    }

    .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 14px;
    }

    .form-hint {
        font-size: 11px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Très petits iPhone (SE, etc.) */
@media screen and (max-width: 340px) {
    .rates-grid {
        padding: 0 8px;
        gap: 8px;
    }

    .payment-methods {
        padding: 0 8px;
    }

    .contacts-tabs {
        padding: 0 8px;
        flex-wrap: wrap;
    }

    .contacts-tab {
        flex: 1 0 auto;
        min-width: calc(50% - 4px);
    }

    .friend-card {
        padding: 10px;
    }

    .page-header {
        padding: 10px;
    }
}

/* Fix débordement horizontal général */
@media screen and (max-width: 400px) {
    body, html {
        overflow-x: hidden;
    }

    #app-container {
        max-width: 100vw;
        overflow-x: hidden;
    }

    #app-content {
        max-width: 100vw;
        overflow-x: hidden;
    }
}

/* Fix pour les tableaux sur petits écrans */
@media screen and (max-width: 400px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 100%;
        font-size: 12px;
    }

    th, td {
        padding: 8px 6px;
    }
}
