/**
 * Kuznek Cookie Consent Styles
 *
 * @package Kuznek
 */

/* ==========================================================================
   Cookie Banner
   ========================================================================== */

#cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--kuznek-dark, #1a1a1a);
    color: var(--kuznek-white, #ffffff);
    padding: 1.5rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s ease, opacity 0.4s ease, visibility 0.4s ease;
}

#cookie-consent-banner.is-visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.cookie-banner-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .cookie-banner-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* Banner Content */
.cookie-banner-content {
    flex: 1;
}

.cookie-banner-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--kuznek-white, #ffffff);
}

.cookie-banner-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
}

.cookie-banner-text a {
    color: var(--kuznek-accent, #c17f24);
    text-decoration: underline;
}

.cookie-banner-text a:hover {
    color: var(--kuznek-secondary, #8b6914);
}

/* Banner Buttons */
.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.cookie-btn:focus {
    outline: 2px solid var(--kuznek-primary, #2d5a27);
    outline-offset: 2px;
}

.cookie-btn-primary {
    background: var(--kuznek-primary, #2d5a27);
    color: var(--kuznek-white, #ffffff);
}

.cookie-btn-primary:hover {
    background: var(--kuznek-primary-dark, #1e3d1a);
    transform: translateY(-1px);
}

.cookie-btn-secondary {
    background: transparent;
    color: var(--kuznek-white, #ffffff);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.cookie-btn-link {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1rem;
    text-decoration: underline;
}

.cookie-btn-link:hover {
    color: var(--kuznek-white, #ffffff);
}

/* ==========================================================================
   Cookie Settings Modal
   ========================================================================== */

#cookie-settings-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#cookie-settings-modal.is-visible {
    opacity: 1;
    visibility: visible;
}

.cookie-modal-content {
    background: var(--kuznek-white, #ffffff);
    color: var(--kuznek-dark, #1a1a1a);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

#cookie-settings-modal.is-visible .cookie-modal-content {
    transform: scale(1);
}

/* Modal Header */
.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.cookie-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--kuznek-dark, #1a1a1a);
}

.cookie-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--kuznek-gray, #6b7280);
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.cookie-modal-close:hover {
    color: var(--kuznek-dark, #1a1a1a);
}

/* Modal Body */
.cookie-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.cookie-modal-intro {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--kuznek-gray, #6b7280);
    margin: 0 0 1.5rem 0;
}

/* Cookie Category */
.cookie-category {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.cookie-category:last-child {
    margin-bottom: 0;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.02);
}

.cookie-category-info {
    flex: 1;
}

.cookie-category-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: var(--kuznek-dark, #1a1a1a);
}

.cookie-category-desc {
    font-size: 0.875rem;
    color: var(--kuznek-gray, #6b7280);
    margin: 0;
    line-height: 1.5;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    flex-shrink: 0;
    margin-left: 1rem;
}

.cookie-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    display: block;
    width: 52px;
    height: 28px;
    background: #d1d5db;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cookie-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: var(--kuznek-white, #ffffff);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: var(--kuznek-primary, #2d5a27);
}

.cookie-toggle input:checked + .cookie-toggle-slider::after {
    transform: translateX(24px);
}

.cookie-toggle input:focus + .cookie-toggle-slider {
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.3);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background: var(--kuznek-primary, #2d5a27);
    opacity: 0.7;
    cursor: not-allowed;
}

/* Always On Badge */
.cookie-always-on {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--kuznek-primary, #2d5a27);
    background: rgba(45, 90, 39, 0.1);
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    margin-left: 1rem;
}

/* Modal Footer */
.cookie-modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.02);
}

.cookie-modal-footer .cookie-btn {
    flex: 1;
    min-width: 140px;
}

.cookie-modal-footer .cookie-btn-secondary {
    color: var(--kuznek-dark, #1a1a1a);
    border-color: rgba(0, 0, 0, 0.2);
}

.cookie-modal-footer .cookie-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Footer Cookie Link
   ========================================================================== */

.cookie-settings-link {
    cursor: pointer;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767px) {
    #cookie-consent-banner {
        padding: 1.25rem;
    }

    .cookie-banner-actions {
        width: 100%;
    }

    .cookie-banner-actions .cookie-btn {
        flex: 1;
        min-width: calc(50% - 0.375rem);
    }

    .cookie-banner-actions .cookie-btn-link {
        width: 100%;
        text-align: center;
    }

    .cookie-modal-content {
        max-height: 85vh;
    }

    .cookie-modal-footer {
        flex-direction: column;
    }

    .cookie-modal-footer .cookie-btn {
        width: 100%;
    }

    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .cookie-toggle,
    .cookie-always-on {
        margin-left: 0;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .cookie-modal-content {
        background: #2a2a2a;
        color: #ffffff;
    }

    .cookie-modal-title,
    .cookie-category-title {
        color: #ffffff;
    }

    .cookie-modal-intro,
    .cookie-category-desc {
        color: rgba(255, 255, 255, 0.7);
    }

    .cookie-modal-header,
    .cookie-modal-footer {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .cookie-modal-footer {
        background: rgba(255, 255, 255, 0.05);
    }

    .cookie-category {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .cookie-category-header {
        background: rgba(255, 255, 255, 0.05);
    }

    .cookie-modal-close {
        color: rgba(255, 255, 255, 0.6);
    }

    .cookie-modal-close:hover {
        color: #ffffff;
    }

    .cookie-modal-footer .cookie-btn-secondary {
        color: #ffffff;
        border-color: rgba(255, 255, 255, 0.3);
    }

    .cookie-modal-footer .cookie-btn-secondary:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ==========================================================================
   Print - Hide Cookie Elements
   ========================================================================== */

@media print {
    #cookie-consent-banner,
    #cookie-settings-modal {
        display: none !important;
    }
}
