/* Estilos para el frontend del plugin Uniagro Manage Cookies */

/* Banner de cookies base */
.uniagro-cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 999999;
    background-color: #000000;
    color: #ffffff;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    display: none !important;
}

/* Clase para mostrar el banner - tiene mayor especificidad */
.uniagro-cookie-banner.uniagro-banner-visible {
    display: block !important;
}

/* Posiciones del banner */
.uniagro-cookie-banner.position-top {
    top: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.uniagro-cookie-banner.position-bottom {
    bottom: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.uniagro-cookie-banner.position-modal {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    margin-left: -250px;  /* Half of max-width (500px / 2) */
    margin-top: -150px;   /* Half of approximate height */
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* Contenido del banner */
.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}

.banner-text {
    flex: 1;
    margin-right: 20px;
}

.banner-text p {
    margin: 0 0 5px 0;
    font-weight: 400;
}

.privacy-link {
    color: inherit;
    text-decoration: underline;
    font-size: 12px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.privacy-link:hover {
    opacity: 1;
    text-decoration: none;
}

/* Botones del banner */
.banner-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: center;
}

.banner-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.banner-buttons button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.banner-buttons button:active {
    transform: translateY(0);
}

.accept-btn {
    background-color: #007cba;
    color: #ffffff;
}

.accept-btn:hover {
    background-color: #005a87;
}

.reject-btn {
    background-color: #dc3232;
    color: #ffffff;
}

.reject-btn:hover {
    background-color: #a02622;
}

.settings-btn {
    background-color: #666666;
    color: #ffffff;
}

.settings-btn:hover {
    background-color: #444444;
}

/* Estilos por tema */
.uniagro-cookie-banner.style-modern {
    background: linear-gradient(135deg, #000000, #333333);
    /* backdrop-filter removido para evitar contextos de apilamiento */
}

.uniagro-cookie-banner.style-minimal {
    background-color: rgba(0,0,0,0.9);
    /* backdrop-filter removido para evitar contextos de apilamiento */
    border: none;
}

.uniagro-cookie-banner.style-classic {
    background-color: #000000;
    border-top: 3px solid #007cba;
}

/* Responsive design */
@media (max-width: 768px) {
    .uniagro-cookie-banner {
        padding: 12px 15px;
    }
    
    .banner-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .banner-text {
        margin-right: 0;
        margin-bottom: 0;
    }
    
    .banner-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .banner-buttons button {
        padding: 8px 16px;
        font-size: 12px;
        min-width: 80px;
    }
    
    .uniagro-cookie-banner.position-modal {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        max-width: none;
        border-radius: 8px 8px 0 0;
    }
}

@media (max-width: 480px) {
    .banner-buttons {
        width: 100%;
    }
    
    .banner-buttons button {
        flex: 1;
        min-width: 0;
    }
}

/* Configuración de cookies (shortcode) */
.uniagro-cookies-settings {
    max-width: 800px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.uniagro-cookies-settings h3 {
    color: #23282d;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.cookie-category {
    margin-bottom: 25px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    overflow: hidden;
}

.cookie-category h4 {
    background: #f8f9fa;
    margin: 0;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e1e1;
    color: #23282d;
    font-size: 16px;
    text-transform: capitalize;
}

.cookies-list {
    padding: 20px;
}

.cookie-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cookie-item:last-child {
    border-bottom: none;
}

.cookie-item strong {
    color: #0073aa;
    font-size: 14px;
}

.cookie-item p {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.consent-controls {
    margin-top: 30px;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.consent-controls .button {
    margin: 0 10px;
    padding: 10px 25px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.consent-controls .accept-all {
    background: #007cba;
    color: white;
}

.consent-controls .accept-all:hover {
    background: #005a87;
}

.consent-controls .reject-all {
    background: #dc3232;
    color: white;
}

.consent-controls .reject-all:hover {
    background: #a02622;
}

/* Animaciones */
@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.uniagro-cookie-banner.position-bottom {
    animation: slideInFromBottom 0.3s ease-out;
}

.uniagro-cookie-banner.position-top {
    animation: slideInFromTop 0.3s ease-out;
}

.uniagro-cookie-banner.position-modal {
    animation: fadeIn 0.3s ease-out;
}

/* Estados de carga y error */
.uniagro-cookie-banner.loading {
    opacity: 0.7;
    pointer-events: none;
}

.uniagro-cookie-banner.error {
    border-left: 4px solid #dc3232;
}

/* Accesibilidad */
.banner-buttons button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.privacy-link:focus {
    outline: 1px dotted #fff;
    outline-offset: 2px;
}

/* Modo alto contraste */
@media (prefers-contrast: high) {
    .uniagro-cookie-banner {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }
    
    .banner-buttons button {
        border: 1px solid #fff;
    }
}

/* Modo movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .uniagro-cookie-banner {
        animation: none;
    }
    
    .banner-buttons button {
        transition: none;
    }
    
    .banner-buttons button:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
    .uniagro-cookies-settings {
        color: #e1e1e1;
    }
    
    .cookie-category {
        background: #2c2c2c;
        border-color: #444;
    }
    
    .cookie-category h4 {
        background: #1e1e1e;
        color: #e1e1e1;
        border-color: #444;
    }
    
    .cookie-item {
        border-color: #444;
    }
    
    .cookie-item p {
        color: #ccc;
    }
    
    .consent-controls {
        background: #1e1e1e;
    }
} 