﻿/* ======================================================
   MIS AVES - RESPONSIVE (PC / TABLET / IPHONE / ANDROID)
====================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

.gp-aves-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: #F5F7FA;
    padding: 16px;
    padding-bottom: 30px;
}

/* ======================================================
   HEADER
====================================================== */
.gp-aves-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

    .gp-aves-header h1 {
        margin: 0;
        font-size: 20px;
        color: #0F172A;
        flex: 1;
        text-align: center;
    }

.gp-btn-back {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gp-btn-add {
    background: linear-gradient(135deg, #0F4C5C, #1B6B7D);
    color: white;
    border: none;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ======================================================
   FILTRO DE GALLERA
====================================================== */
.gp-aves-filter {
    background: white;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

    .gp-aves-filter label {
        font-size: 13px;
        font-weight: 600;
        color: #64748B;
        white-space: nowrap;
    }

    .gp-aves-filter select {
        flex: 1;
        border: 1px solid #E2E8F0;
        border-radius: 10px;
        padding: 10px 12px;
        font-size: 14px;
        background: #F8FAFC;
        color: #0F172A;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
    }

/* ======================================================
   RESUMEN POR ESTADO (SCROLL HORIZONTAL EN MÓVIL)
====================================================== */
.gp-aves-resumen {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

    .gp-aves-resumen::-webkit-scrollbar {
        display: none;
    }

.gp-resumen-card {
    flex-shrink: 0;
    background: white;
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 14px 18px;
    min-width: 100px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
}

    .gp-resumen-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0,0,0,.10);
    }

    .gp-resumen-card.active {
        border-color: #0F4C5C;
        background: linear-gradient(135deg, #0F4C5C, #1B6B7D);
        color: white;
    }

        .gp-resumen-card.active .gp-resumen-label {
            color: rgba(255,255,255,.85);
        }

.gp-resumen-num {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
}

.gp-resumen-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* ======================================================
   BÚSQUEDA
====================================================== */
.gp-aves-busqueda {
    margin-bottom: 12px;
}

    .gp-aves-busqueda input {
        width: 100%;
        border: 1px solid #E2E8F0;
        border-radius: 14px;
        padding: 12px 16px;
        font-size: 16px; /* Previene zoom en iOS */
        background: white;
        box-shadow: 0 4px 12px rgba(0,0,0,.06);
    }

        .gp-aves-busqueda input:focus {
            outline: none;
            border-color: #0F4C5C;
        }

/* ======================================================
   LISTADO DE AVES
====================================================== */
.gp-aves-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gp-ave-card {
    background: white;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
    transition: transform .1s;
}

    .gp-ave-card:active {
        transform: scale(0.995);
    }

.gp-ave-main {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #F1F5F9;
}

.gp-ave-placa {
    background: linear-gradient(135deg, #0F4C5C, #1B6B7D);
    color: white;
    font-size: 13px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 8px;
}

.gp-ave-anillo {
    font-size: 13px;
    color: #64748B;
    font-weight: 600;
}

.gp-ave-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    margin-bottom: 10px;
}

.gp-ave-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gp-ave-label {
    font-size: 10px;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.gp-ave-value {
    font-size: 13px;
    color: #0F172A;
    font-weight: 600;
}

.gp-ave-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #F1F5F9;
}

.gp-ave-estado {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Estados de color */
.reproductor-estado {
    background: #DBEAFE;
    color: #1E40AF;
}

.para-pelea-estado {
    background: #DCFCE7;
    color: #166534;
}

.prestado-estado {
    background: #FEF3C7;
    color: #92400E;
}

.herido-estado {
    background: #FEE2E2;
    color: #991B1B;
}

.en-preparacion-estado {
    background: #E0E7FF;
    color: #3730A3;
}

.descanso-estado {
    background: #F3E8FF;
    color: #6B21A8;
}

.vendido-estado {
    background: #E5E7EB;
    color: #374151;
}

.gp-ave-actions {
    display: flex;
    gap: 6px;
}

.gp-btn-edit, .gp-btn-estado {
    background: #F1F5F9;
    border: none;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

    .gp-btn-edit:hover {
        background: #DBEAFE;
    }

    .gp-btn-estado:hover {
        background: #DCFCE7;
    }

/* ======================================================
   EMPTY STATE
====================================================== */
.gp-aves-empty {
    text-align: center;
    padding: 40px 20px;
}

.gp-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.gp-aves-empty p {
    color: #94A3B8;
    font-size: 14px;
    margin-bottom: 16px;
}

.gp-btn-primary {
    background: linear-gradient(135deg, #0F4C5C, #1B6B7D);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

/* ======================================================
   MODAL CAMBIO DE ESTADO
====================================================== */
.gp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(3px);
    z-index: 1000;
    animation: fadeIn .2s ease;
}

.gp-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 360px;
    background: white;
    border-radius: 20px;
    padding: 20px;
    z-index: 1001;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: modalPop .3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

    .gp-modal-header h3 {
        margin: 0;
        font-size: 18px;
        color: #0F172A;
    }

    .gp-modal-header button {
        background: none;
        border: none;
        font-size: 24px;
        color: #94A3B8;
        cursor: pointer;
    }

.gp-modal-body {
    margin-bottom: 16px;
}

    .gp-modal-body p {
        margin: 0 0 10px 0;
        font-size: 14px;
        color: #475569;
    }

    .gp-modal-body label {
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: #64748B;
        margin-bottom: 6px;
        text-transform: uppercase;
    }

    .gp-modal-body select {
        width: 100%;
        border: 1px solid #E2E8F0;
        border-radius: 12px;
        padding: 12px;
        font-size: 16px;
        background: #F8FAFC;
    }

.gp-estado-actual {
    font-weight: 700;
    color: #0F4C5C;
}

.gp-modal-footer {
    display: flex;
    gap: 10px;
}

    .gp-modal-footer button {
        flex: 1;
        padding: 12px;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        border: none;
    }

.gp-btn-cancel {
    background: #F1F5F9;
    color: #64748B;
}

.gp-btn-save {
    background: linear-gradient(135deg, #0F4C5C, #1B6B7D);
    color: white;
}

/* ======================================================
   ANIMACIONES
====================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalPop {
    from {
        transform: translate(-50%, -50%) scale(.9);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* ======================================================
   RESPONSIVE - TABLET Y PC
====================================================== */
@media (min-width: 768px) {

    .gp-aves-page {
        padding: 24px;
        max-width: 900px;
        margin: 0 auto;
    }

    .gp-aves-header h1 {
        font-size: 24px;
    }

    .gp-aves-resumen {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        overflow-x: visible;
    }

    .gp-resumen-card {
        min-width: auto;
    }

    .gp-ave-card {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 16px;
        padding: 16px 20px;
    }

    .gp-ave-main {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        gap: 4px;
    }

    .gp-ave-info {
        grid-template-columns: repeat(4, 1fr);
        margin-bottom: 0;
    }

    .gp-ave-footer {
        flex-direction: column;
        gap: 8px;
        padding-top: 0;
        border-top: none;
    }
}

@media (min-width: 1024px) {

    .gp-aves-page {
        max-width: 1100px;
    }

    .gp-ave-info {
        grid-template-columns: repeat(5, 1fr);
    }
}
