/**
 * Kodix Cookie Consent - Front CSS
 *
 * @author    Kodix
 * @copyright 2026 Kodix
 * @license   Proprietary
 */

/* =========================================================================
   Reset & Utility
   ========================================================================= */

.kcc-hidden {
    display: none !important;
}

.kcc-no-scroll {
    overflow: hidden !important;
}

/* =========================================================================
   Overlay
   ========================================================================= */

.kcc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999998;
    transition: opacity 0.3s ease;
}

/* =========================================================================
   Modal
   ========================================================================= */

.kcc-modal {
    position: fixed;
    z-index: 999999;
    background: #ffffff;
    color: #333333;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    box-sizing: border-box;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.kcc-modal.kcc-visible {
    opacity: 1;
}

/* Position variants */
.kcc-modal--center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.kcc-modal--bottom {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.kcc-modal--top {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

/* Animation variants */
.kcc-anim-fade.kcc-hidden {
    opacity: 0;
    pointer-events: none;
}

.kcc-anim-slide.kcc-modal--center.kcc-hidden {
    opacity: 0;
    transform: translate(-50%, -40%);
    pointer-events: none;
}

.kcc-anim-slide.kcc-modal--bottom.kcc-hidden {
    transform: translateX(-50%) translateY(100%);
    pointer-events: none;
}

.kcc-anim-slide.kcc-modal--top.kcc-hidden {
    transform: translateX(-50%) translateY(-100%);
    pointer-events: none;
}

.kcc-anim-none.kcc-hidden {
    pointer-events: none;
}

/* =========================================================================
   Logo
   ========================================================================= */

.kcc-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 28px 16px;
}

.kcc-logo img {
    max-height: 50px;
    width: auto !important;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto;
}

/* =========================================================================
   Content
   ========================================================================= */

.kcc-content {
    padding: 0 28px 24px 28px;
}

.kcc-default-content h3 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.kcc-default-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #555 !important;
}

/* =========================================================================
   Buttons
   ========================================================================= */

.kcc-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 28px;
    border-top: 1px solid #eee;
}

.kcc-buttons--left {
    justify-content: flex-start;
}

.kcc-buttons--center {
    justify-content: center;
}

.kcc-buttons--right {
    justify-content: flex-end;
}

.kcc-btn {
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
    line-height: 1.3;
    white-space: nowrap;
    font-family: inherit;
}

.kcc-btn:hover {
    opacity: 0.85;
}

.kcc-btn:active {
    transform: scale(0.97);
}

/* Refuse button - independent wrapper */
.kcc-btn-refuse-wrap {
    display: flex;
    padding: 8px 28px;
}

.kcc-btn-refuse-wrap--left {
    justify-content: flex-start;
}

.kcc-btn-refuse-wrap--center {
    justify-content: center;
}

.kcc-btn-refuse-wrap--right {
    justify-content: flex-end;
}

/* Refuse button - text (link) mode */
.kcc-btn-refuse--text {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 4px 0;
    text-decoration: underline;
    font-weight: 400;
}

.kcc-btn-refuse--text:hover {
    opacity: 0.7;
}

.kcc-btn-refuse--text:active {
    transform: none;
}

/* Refuse - inline text link */
.kcc-btn-refuse-link {
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 400;
    font-family: inherit;
    display: inline-block;
}

.kcc-btn-refuse-link:hover {
    opacity: 0.7;
}

/* =========================================================================
   Detail view — Categories
   ========================================================================= */

.kcc-categories {
    padding: 16px 28px;
}

.kcc-category {
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}

.kcc-category:last-child {
    border-bottom: none;
}

.kcc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kcc-category-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kcc-category-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.kcc-category-count {
    font-size: 12px;
    color: #999;
}

.kcc-category-desc {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #666 !important;
}

/* =========================================================================
   Toggle switch
   ========================================================================= */

.kcc-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.kcc-toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

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

.kcc-toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.kcc-toggle-input:checked + .kcc-toggle-slider {
    background-color: #fa8907;
}

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

.kcc-toggle--disabled .kcc-toggle-slider {
    background-color: #4CAF50;
    cursor: not-allowed;
    opacity: 0.7;
}

.kcc-toggle--disabled .kcc-toggle-slider::before {
    transform: translateX(20px);
}

/* =========================================================================
   Cookie details table
   ========================================================================= */

.kcc-cookie-list {
    margin-top: 8px;
}

.kcc-cookie-toggle-list {
    background: none;
    border: none;
    color: #fa8907;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    text-decoration: underline;
    font-family: inherit;
}

.kcc-cookie-toggle-list:hover {
    opacity: 0.7;
}

.kcc-cookie-details {
    margin-top: 8px;
}

.kcc-cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.kcc-cookie-table th,
.kcc-cookie-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.kcc-cookie-table th {
    font-weight: 600;
    color: #333;
    background: #fafafa;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kcc-cookie-table td {
    color: #666;
}

/* =========================================================================
   Detail CE content
   ========================================================================= */

.kcc-detail-ce-content {
    padding: 20px 28px 0;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 768px) {
    .kcc-modal {
        width: calc(100% - 32px) !important;
        max-height: 90vh !important;
        border-radius: 12px !important;
    }

    .kcc-modal--center {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .kcc-modal--bottom {
        left: 50%;
        transform: translateX(-50%);
        margin-bottom: 16px;
        max-height: 85vh !important;
        border-bottom-left-radius: 12px !important;
        border-bottom-right-radius: 12px !important;
    }

    .kcc-modal--top {
        left: 50%;
        transform: translateX(-50%);
        margin-top: 16px;
        max-height: 85vh !important;
        border-top-left-radius: 12px !important;
        border-top-right-radius: 12px !important;
    }

    .kcc-anim-slide.kcc-modal--center.kcc-hidden {
        transform: translate(-50%, -40%);
        opacity: 0;
    }

    .kcc-anim-slide.kcc-modal--bottom.kcc-hidden {
        transform: translateX(-50%) translateY(100%);
    }

    .kcc-anim-slide.kcc-modal--top.kcc-hidden {
        transform: translateX(-50%) translateY(-100%);
    }

    .kcc-buttons {
        flex-direction: column;
        padding: 12px 16px;
    }

    .kcc-btn {
        width: 100%;
        text-align: center;
    }

    .kcc-content {
        padding: 16px;
    }

    .kcc-content img {
        max-height: 50px;
        width: auto !important;
        max-width: none !important;
        object-fit: contain;
    }

    .kcc-categories {
        padding: 12px 16px;
    }

    .kcc-cookie-table {
        font-size: 11px;
    }

    .kcc-cookie-table th,
    .kcc-cookie-table td {
        padding: 4px 6px;
    }

    .kcc-btn-refuse-wrap {
        padding: 8px 16px;
    }

    .kcc-btn-refuse--text {
        width: auto;
    }
}
