/**
 * Dukiwi Cookie Consent - Frontend Styles
 * 
 * @package Dukiwi_Cookie_Consent
 * @author Dukiwi SA
 * @license GPL-2.0-or-later
 */

/* Reset & Base */
.dcc-banner *,
.dcc-banner *::before,
.dcc-banner *::after,
.dcc-modal *,
.dcc-modal *::before,
.dcc-modal *::after {
    box-sizing: border-box;
}

/* ========================================
   BANNIÈRE
   ======================================== */

.dcc-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.dcc-banner.dcc-position-bottom {
    bottom: 0;
}

.dcc-banner.dcc-position-top {
    top: 0;
}

.dcc-banner.dcc-position-center {
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px;
}

.dcc-banner-container {
    background-color: var(--dcc-bg-color, #ffffff);
    color: var(--dcc-text-color, #1f2937);
    padding: 24px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    max-width: 100%;
}

.dcc-position-center .dcc-banner-container {
    max-width: 600px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dcc-position-top .dcc-banner-container {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.dcc-banner-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--dcc-primary-color, #013861);
}

.dcc-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--dcc-primary-color, #013861);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dcc-title i {
    font-size: 24px;
}

.dcc-banner-content {
    margin-bottom: 20px;
}

.dcc-description {
    margin: 0 0 12px;
    color: var(--dcc-text-color, #1f2937);
}

.dcc-privacy-link {
    margin: 0;
}

.dcc-privacy-link a {
    color: var(--dcc-primary-color, #013861);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.dcc-privacy-link a:hover {
    text-decoration: underline;
}

/* Buttons */
.dcc-banner-actions,
.dcc-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.dcc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.dcc-btn:focus {
    outline: 2px solid var(--dcc-primary-color, #013861);
    outline-offset: 2px;
}

.dcc-btn-accept {
    background-color: var(--dcc-accept-color, #16a34a);
    color: white;
}

.dcc-btn-accept:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.dcc-btn-reject {
    background-color: var(--dcc-reject-color, #dc2626);
    color: white;
}

.dcc-btn-reject:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.dcc-btn-settings {
    background-color: var(--dcc-settings-color, #6b7280);
    color: white;
}

.dcc-btn-settings:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Banner Footer */
.dcc-banner-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.dcc-banner-footer p {
    margin: 0;
    font-size: 12px;
    color: var(--dcc-text-color, #1f2937);
    opacity: 0.7;
}

.dcc-legal-notice {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dcc-legal-notice i {
    color: var(--dcc-primary-color, #013861);
}

.dcc-powered-by a {
    color: var(--dcc-primary-color, #013861);
    text-decoration: none;
}

.dcc-powered-by a:hover {
    text-decoration: underline;
}

/* ========================================
   MODALE PARAMÈTRES
   ======================================== */

.dcc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.dcc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
}

.dcc-modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--dcc-bg-color, #ffffff);
    color: var(--dcc-text-color, #1f2937);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dcc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 2px solid var(--dcc-primary-color, #013861);
}

.dcc-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--dcc-text-color, #1f2937);
    opacity: 0.6;
    transition: opacity 0.2s ease;
    padding: 8px;
    border-radius: 50%;
}

.dcc-modal-close:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05);
}

.dcc-modal-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.dcc-modal-intro {
    margin: 0 0 16px;
    color: var(--dcc-text-color, #1f2937);
}

.dcc-modal-content .dcc-privacy-link {
    margin-bottom: 20px;
}

/* Categories */
.dcc-categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dcc-category {
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.dcc-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.dcc-category-name {
    flex: 1;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dcc-required-badge {
    font-size: 11px;
    background-color: var(--dcc-primary-color, #013861);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.dcc-category-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--dcc-text-color, #1f2937);
    opacity: 0.6;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.dcc-category-toggle:hover {
    opacity: 1;
}

.dcc-category-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.dcc-category-description {
    padding: 0 16px 16px;
    margin: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 12px;
    
}

.dcc-category-description p {
    margin: 0;
    font-size: 13px;
    color: var(--dcc-text-color, #1f2937);
    opacity: 0.8;
    white-space: pre-line;
    line-height: 1.6;
    text-align: left;
}

/* Toggle Switch */
.dcc-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.dcc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.dcc-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.dcc-toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dcc-toggle input:checked + .dcc-toggle-slider {
    background-color: var(--dcc-accept-color, #16a34a);
}

.dcc-toggle input:checked + .dcc-toggle-slider::before {
    transform: translateX(22px);
}

.dcc-toggle input:disabled + .dcc-toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal Actions & Footer */
.dcc-modal-actions {
    padding: 20px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background-color: rgba(0, 0, 0, 0.02);
}

.dcc-modal-footer {
    padding: 12px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
}

.dcc-modal-footer p {
    margin: 0;
    font-size: 12px;
    color: var(--dcc-text-color, #1f2937);
    opacity: 0.7;
}

/* ========================================
   BOUTON FLOTTANT
   ======================================== */

.dcc-settings-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999998;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--dcc-primary-color, #013861);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.dcc-settings-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

/* ========================================
   NOTIFICATION
   ======================================== */

.dcc-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999999;
    background-color: var(--dcc-accept-color, #16a34a);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    animation: dcc-slide-in 0.3s ease;
}

@keyframes dcc-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .dcc-banner-container {
        padding: 16px;
    }

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

    .dcc-banner-actions,
    .dcc-modal-actions {
        flex-direction: column;
    }

    .dcc-btn {
        width: 100%;
        justify-content: center;
    }

    .dcc-banner-footer {
        flex-direction: column;
        text-align: center;
    }

    .dcc-modal-container {
        width: 95%;
        max-height: 95vh;
    }

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

    .dcc-modal-content {
        padding: 16px;
    }

    .dcc-modal-actions {
        padding: 16px;
    }

    .dcc-category-header {
        padding: 12px;
    }

    .dcc-toggle {
        width: 42px;
        height: 24px;
    }

    .dcc-toggle-slider::before {
        height: 18px;
        width: 18px;
    }

    .dcc-toggle input:checked + .dcc-toggle-slider::before {
        transform: translateX(18px);
    }

    .dcc-settings-toggle {
        width: 45px;
        height: 45px;
        font-size: 20px;
        bottom: 15px;
        left: 15px;
    }
}

/* Print - Hide */
@media print {
    .dcc-banner,
    .dcc-modal,
    .dcc-settings-toggle,
    .dcc-notification {
        display: none !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .dcc-banner *,
    .dcc-modal *,
    .dcc-settings-toggle,
    .dcc-notification {
        animation: none !important;
        transition: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .dcc-banner-container,
    .dcc-modal-container {
        border: 2px solid currentColor;
    }

    .dcc-btn {
        border: 2px solid currentColor;
    }

    .dcc-toggle-slider {
        border: 2px solid currentColor;
    }

    .dcc-category {
        border: 2px solid currentColor;
    }
}
