/* Banner Cookie GDPR - Stili Frontend */

:root {
    --wpgcc-banner-bg: #ffffff;
    --wpgcc-banner-text: #333333;
    --wpgcc-button-bg: #0073aa;
    --wpgcc-button-text: #ffffff;
    --wpgcc-overlay-bg: rgba(0, 0, 0, 0.5);
    --wpgcc-border-radius: 8px;
    --wpgcc-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Banner principale */
.wpgcc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--wpgcc-banner-bg);
    color: var(--wpgcc-banner-text);
    padding: 20px;
    box-shadow: var(--wpgcc-shadow);
    z-index: 9999;
    animation: wpgcc-slide-up 0.4s ease-out;
}

@keyframes wpgcc-slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.wpgcc-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.wpgcc-banner-text {
    flex: 1;
}

.wpgcc-banner-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--wpgcc-banner-text);
}

.wpgcc-banner-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--wpgcc-banner-text);
    opacity: 0.9;
}

.wpgcc-banner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Posizioni del banner */
.wpgcc-position-bottom-left {
    left: 20px;
    right: auto;
    max-width: 450px;
    border-radius: var(--wpgcc-border-radius) var(--wpgcc-border-radius) 0 0;
}

.wpgcc-position-bottom-right {
    right: 20px;
    left: auto;
    max-width: 450px;
    border-radius: var(--wpgcc-border-radius) var(--wpgcc-border-radius) 0 0;
}

.wpgcc-position-bottom-center {
    left: 0;
    right: 0;
}

/* Pulsanti */
.wpgcc-button {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.wpgcc-button-primary {
    background: var(--wpgcc-button-bg);
    color: var(--wpgcc-button-text);
}

.wpgcc-button-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.wpgcc-button-secondary {
    background: transparent;
    color: var(--wpgcc-banner-text);
    border: 2px solid var(--wpgcc-banner-text);
}

.wpgcc-button-secondary:hover {
    background: var(--wpgcc-banner-text);
    color: var(--wpgcc-banner-bg);
}

.wpgcc-button-link {
    background: transparent;
    color: var(--wpgcc-button-bg);
    text-decoration: underline;
    padding: 12px 16px;
}

.wpgcc-button-link:hover {
    opacity: 0.8;
}

/* Modal Preferenze */
.wpgcc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wpgcc-fade-in 0.3s ease;
}

@keyframes wpgcc-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.wpgcc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--wpgcc-overlay-bg);
}

.wpgcc-modal-content {
    position: relative;
    background: #fff;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    border-radius: var(--wpgcc-border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: wpgcc-scale-in 0.3s ease;
}

@keyframes wpgcc-scale-in {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.wpgcc-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wpgcc-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.wpgcc-modal-close {
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.wpgcc-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.wpgcc-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.wpgcc-modal-body > p {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.6;
}

.wpgcc-categories {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wpgcc-category-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.wpgcc-category-item:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.wpgcc-category-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.wpgcc-category-info {
    flex: 1;
}

.wpgcc-category-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}

.wpgcc-category-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.wpgcc-required-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    background: #e0e0e0;
    color: #666;
    font-size: 12px;
    border-radius: 3px;
    font-style: normal;
}

/* Switch Toggle */
.wpgcc-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.wpgcc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wpgcc-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.wpgcc-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .wpgcc-slider {
    background-color: var(--wpgcc-button-bg);
}

input:checked + .wpgcc-slider:before {
    transform: translateX(22px);
}

input:disabled + .wpgcc-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.wpgcc-modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Badge permanente per riaprire preferenze */
.wpgcc-reopen-badge {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9998;
    animation: wpgcc-fade-in 0.3s ease;
}

.wpgcc-reopen-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--wpgcc-button-bg);
    color: var(--wpgcc-button-text);
    border: none;
    padding: 10px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.wpgcc-reopen-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.wpgcc-reopen-button svg {
    flex-shrink: 0;
}

/* Responsive per mobile */
@media (max-width: 768px) {
    .wpgcc-reopen-badge {
        bottom: 10px;
        left: 10px;
    }
    
    .wpgcc-reopen-button {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .wpgcc-reopen-button svg {
        width: 16px;
        height: 16px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .wpgcc-banner-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .wpgcc-banner-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .wpgcc-button {
        width: 100%;
        text-align: center;
    }
    
    .wpgcc-position-bottom-left,
    .wpgcc-position-bottom-right {
        left: 0;
        right: 0;
        max-width: 100%;
        border-radius: 0;
    }
    
    .wpgcc-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .wpgcc-category-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .wpgcc-modal-footer {
        flex-direction: column;
    }
    
    .wpgcc-modal-footer .wpgcc-button {
        width: 100%;
    }
}

/* Accessibilità */
.wpgcc-button:focus,
.wpgcc-modal-close:focus {
    outline: 2px solid var(--wpgcc-button-bg);
    outline-offset: 2px;
}

.wpgcc-category-checkbox:focus + .wpgcc-slider {
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
}

/* Animazione per nascondere il banner */
.wpgcc-banner.wpgcc-hiding {
    animation: wpgcc-slide-down 0.3s ease-out forwards;
}

@keyframes wpgcc-slide-down {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}
