/* Admin Panel Styles */
body {
    background: #f4f4f4;
    margin: 0;
    padding: 0;
}

.admin-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==================== */
/* FORM INPUTS - VISIBILIDAD MEJORADA */
/* ==================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.9rem 1.2rem;
    font-size: 15px;
    color: #333;
    background: #ffffff;
    border: 2px solid #d0d0d0 !important;
    /* Borde gris visible */
    border-radius: 10px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box;
    outline: none !important;
}

input::placeholder,
textarea::placeholder {
    color: #999;
}

/* Efecto al pasar el ratón */
input:hover,
select:hover,
textarea:hover {
    border-color: #999 !important;
    /* Borde más oscuro al pasar el ratón */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1) !important;
}

/* Efecto al escribir */
input:focus,
select:focus,
textarea:focus {
    border-color: #FF9AA2 !important;
    /* Color rosa del tema al escribir */
    box-shadow: 0 0 0 4px rgba(255, 154, 162, 0.15) !important;
    transform: translateY(-1px);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 20px;
    padding-right: 3rem;
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

/* ==================== */
/* HAMBURGER MENU */
/* ==================== */
.hamburger-btn {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1002;
    background: var(--primary-gradient);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 4px 15px rgba(255, 154, 162, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hamburger-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 154, 162, 0.6);
}

.hamburger-btn:active {
    transform: scale(0.95);
}

.hamburger-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Close Menu Button */
.close-menu-btn {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    width: 40px;
    height: 40px;
    background: #e74c3c;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.close-menu-btn:hover {
    background: #c0392b;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.5);
}

.close-menu-btn:active {
    transform: scale(0.95);
}

/* ==================== */
/* SIDE MENU */
/* ==================== */
.admin-menu-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: #ffffff;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    padding: 6rem 1.5rem 2rem;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.admin-menu-dropdown.active {
    transform: translateX(0);
}

.admin-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
}

.admin-nav li {
    margin: 0;
    width: 100%;
}

.admin-nav a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 1rem 1.2rem;
    background: #fff;
    color: #555;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    min-height: 54px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.admin-nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.admin-nav a:hover::before {
    left: 100%;
}

.admin-nav a:hover {
    background: #fdfdfd;
    transform: translateX(5px);
    border-color: #FFB7B2;
    color: #FF9AA2;
    box-shadow: 0 4px 12px rgba(255, 154, 162, 0.15);
}

.admin-nav a:active {
    transform: translateY(-1px) scale(0.98);
}

.admin-nav a.active {
    background: linear-gradient(135deg, #FF9AA2 0%, #FFB7B2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(255, 154, 162, 0.4);
}

.admin-nav a.active:hover {
    transform: none;
    box-shadow: 0 6px 20px rgba(255, 154, 162, 0.5);
}

/* Special Buttons */
.admin-nav a.btn-web {
    margin-top: 1rem;
    background: #f8f9fa;
    border: 2px dashed #c7ceea;
    color: #667eea;
    justify-content: center;
}

.admin-nav a.btn-web:hover {
    background: #f0f4ff;
    border-color: #667eea;
    transform: translateY(-2px);
}

.admin-nav a.btn-logout {
    margin-top: 0.5rem;
    background: #fff0f1;
    color: #f5576c;
    border: 1px solid #ffcdd2;
    justify-content: center;
}

.admin-nav a.btn-logout:hover {
    background: #ffebee;
    border-color: #f5576c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.2);
}

/* Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ==================== */
/* MAIN CONTENT */
/* ==================== */
main {
    flex: 1;
    padding: 2rem;
    padding-top: 6rem;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

main h1 {
    margin-top: 0;
}

/* ==================== */
/* CARDS & GRID */
/* ==================== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-content {
    padding: 1.5rem;
}

/* ==================== */
/* BUTTONS */
/* ==================== */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--primary-gradient);
    color: #fff;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 154, 162, 0.4);
}

/* Estilos globales para botones de acción en tarjetas */
.card-content .btn,
.card-content form button[style*="color:red"],
.card-content form button[style*="color: red"],
.card-content a[onclick*="confirm"][style*="color: red"],
.card-content a[onclick*="confirm"][style*="color:red"],
.card-content a[href*="delete"] {
    min-width: 130px !important;
    height: 42px !important;
    padding: 0 1.5rem !important;
    font-size: 0.9rem !important;
    border-radius: 50px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    box-sizing: border-box !important;
    border: none !important;
    transition: all 0.3s ease !important;
    line-height: 1 !important;
    margin: 0 !important;
    text-decoration: none !important;
}

/* Specifics for Edit button (Green) */
.card-content .btn {
    background: var(--primary-gradient) !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
}

/* Override for Edit buttons that have inline green background */
.card-content a[href*="edit"][style*="background"] {
    background: #4CAF50 !important;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.4) !important;
}

/* Specifics for Delete button (Red) */
.card-content form button[style*="color:red"],
.card-content form button[style*="color: red"],
.card-content a[onclick*="confirm"][style*="color: red"],
.card-content a[onclick*="confirm"][style*="color:red"],
.card-content a[href*="delete"] {
    background: #ff6b6b !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.4) !important;
}

/* Hover effects */
.card-content .btn:hover,
.card-content form button:hover,
.card-content a[onclick*="confirm"]:hover,
.card-content a[href*="delete"]:hover {
    transform: translateY(-2px) !important;
}

.card-content .btn:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2) !important;
}

.card-content a[href*="edit"][style*="background"]:hover {
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.6) !important;
}

.card-content form button:hover,
.card-content a[onclick*="confirm"][style*="color"]:hover,
.card-content a[href*="delete"]:hover {
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.6) !important;
}

/* Fix disabled buttons in guest mode */
.card-content span.btn,
.card-content span[style*="cursor: not-allowed"] {
    background: #ccc !important;
    color: #666 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ==================== */
/* RESPONSIVE */
/* ==================== */
@media (min-width: 769px) {
    body.menu-active main {
        margin-left: 300px;
    }

    body.menu-active .menu-overlay {
        opacity: 0;
        pointer-events: none;
    }
}

@media (max-width: 768px) {
    .hamburger-btn {
        top: 1rem !important;
        left: 1rem !important;
        width: 45px !important;
        height: 45px !important;
        min-width: 45px !important;
        border-radius: 8px !important;
        transition: background 0.3s ease, box-shadow 0.3s ease !important;
        transform: none !important;
        animation: none !important;
    }

    .hamburger-btn span {
        width: 22px !important;
        transition: all 0.3s ease !important;
    }

    .close-menu-btn {
        top: 1rem !important;
        left: 1rem !important;
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
    }

    .hamburger-btn:hover,
    .hamburger-btn:active,
    .hamburger-btn:focus {
        transform: none !important;
        top: 1rem !important;
        left: 1rem !important;
    }

    .admin-menu-dropdown {
        width: 280px;
        padding-top: 5rem;
    }

    main {
        padding: 1.5rem;
        padding-top: 5rem;
    }

    body.menu-active main {
        margin-left: 0;
    }

    /* Grid adjustment */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Card adjustments */
    .card {
        padding: 1.5rem !important;
    }

    /* Typography */
    h1 {
        font-size: 1.8rem !important;
        margin-bottom: 1rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
        margin-top: 2rem !important;
    }

    h3 {
        font-size: 1.2rem !important;
    }

    /* Forms */
    .form-group {
        margin-bottom: 1rem !important;
    }

    input,
    select,
    textarea,
    button,
    .btn {
        font-size: 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Buttons */
    .btn {
        padding: 0.8rem 1rem !important;
        display: block !important;
        text-align: center !important;
        margin-bottom: 0.5rem !important;
    }

    /* Tables / Lists */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Flex containers to column */
    .flex-mobile-column {
        flex-direction: column !important;
    }

    /* Adjust spacing */
    main {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Card content spacing */
    .card-content {
        padding: 1rem !important;
    }

    /* Images */
    img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Actions buttons in lists - FORCE FULL WIDTH COLUMN LAYOUT */
    div[style*="display: flex"],
    div[style*="display:flex"] {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.8rem !important;
    }

    /* Ensure direct children (buttons/links) take full width */
    div[style*="display: flex"]>*,
    div[style*="display:flex"]>* {
        width: 100% !important;
        margin: 0 !important;
        flex: 1 1 auto !important;
    }

    /* HIGH SPECIFICITY SELECTORS TO OVERRIDE GLOBAL STYLES */
    .card-content a.btn,
    .card-content form button,
    .card-content form button[style*="color"],
    .card-content a[onclick*="confirm"],
    .card-content a[onclick*="confirm"][style*="color"],
    .card-content a[href*="delete"] {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        box-sizing: border-box !important;

        /* Typography identity */
        font-family: var(--font-heading, sans-serif) !important;
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        text-decoration: none !important;

        /* Box model identity */
        height: 50px !important;
        padding: 0 !important;
        border-radius: 50px !important;
        border: none !important;
        margin-bottom: 0.8rem !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;

        /* Reset native styles */
        -webkit-appearance: none !important;
        appearance: none !important;
    }

    /* Specific colors for mobile */
    .card-content form button,
    .card-content form button[style*="color"],
    .card-content a[onclick*="confirm"],
    .card-content a[href*="delete"] {
        background: #ff6b6b !important;
        color: white !important;
        box-shadow: 0 4px 10px rgba(255, 107, 107, 0.4) !important;
    }

    .card-content a.btn {
        /* Green gradient already inherited */
        background: transparent;
    }

    /* Fix forms that wrap buttons */
    .card-content form {
        width: 100% !important;
        display: block !important;
        margin: 0 !important;
    }

    /* Add hover effect for mobile buttons */
    .card-content form button:active,
    .card-content a.btn:active,
    .card-content a[href*="delete"]:active {
        transform: translateY(2px) !important;
    }
}

/* Scrollbar */
.admin-menu-dropdown::-webkit-scrollbar {
    width: 6px;
}

.admin-menu-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.admin-menu-dropdown::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 10px;
}

.admin-menu-dropdown::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* ==================== */
/* BOTÓN AÑADIR PRINCIPAL (OVERRIDE) */
/* ==================== */
.btn-add-main {
    /* Color azul sólido y suave */
    background: #54a0ff !important;
    box-shadow: 0 4px 12px rgba(84, 160, 255, 0.4) !important;
    color: white !important;

    /* Espaciado base */
    margin: 2rem 0 4rem 0 !important;

    /* Estructura */
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 1.2rem 2.5rem !important;
    border-radius: 50px !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    border: none !important;
    transition: all 0.2s ease !important;
    width: auto !important;
}

.btn-add-main:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(84, 160, 255, 0.6) !important;
    background: #2e86de !important;
    /* Un poco más oscuro al hover */
}

.btn-add-main:active {
    transform: translateY(0) !important;
}

.btn-add-main i {
    font-size: 1.3rem !important;
}

@media (max-width: 768px) {
    .btn-add-main {
        width: 100% !important;
        /* Ancho completo en móvil */
        margin-top: 1.5rem !important;
        margin-bottom: 3rem !important;
        /* Espacio reducido a la mitad */
        padding: 1rem !important;
        box-shadow: 0 4px 10px rgba(84, 160, 255, 0.3) !important;
    }
}