/**
 * PopustKod Cookie Consent Styles
 *
 * Matches the site's design system
 *
 * @package PopustKod
 * @version 1.0.0
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --pk-cookie-primary: #FF6B35;
    --pk-cookie-primary-hover: #e85a28;
    --pk-cookie-dark: #1a1a2e;
    --pk-cookie-gray: #6b7280;
    --pk-cookie-light: #f8f9fa;
    --pk-cookie-white: #ffffff;
    --pk-cookie-border: #e5e7eb;
    --pk-cookie-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --pk-cookie-radius: 12px;
    --pk-cookie-radius-sm: 8px;
    --pk-cookie-font: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   Banner - Bottom Bar
   ============================================ */
.pk-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--pk-cookie-white);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    font-family: var(--pk-cookie-font);
    animation: pkSlideUp 0.3s ease-out;
}

.pk-cookie-banner[hidden] {
    display: none;
}

@keyframes pkSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pk-cookie-banner__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.pk-cookie-banner__content {
    flex: 1;
    min-width: 280px;
}

.pk-cookie-banner__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--pk-cookie-dark);
    margin: 0 0 8px 0;
}

.pk-cookie-banner__title svg {
    color: var(--pk-cookie-primary);
    flex-shrink: 0;
}

.pk-cookie-banner__text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--pk-cookie-gray);
    margin: 0 0 8px 0;
}

.pk-cookie-banner__links {
    font-size: 13px;
    margin: 0;
}

.pk-cookie-banner__links a {
    color: var(--pk-cookie-primary);
    text-decoration: none;
}

.pk-cookie-banner__links a:hover {
    text-decoration: underline;
}

.pk-cookie-banner__links span {
    color: var(--pk-cookie-border);
    margin: 0 8px;
}

.pk-cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ============================================
   Buttons
   ============================================ */
.pk-cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    font-family: var(--pk-cookie-font);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--pk-cookie-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

.pk-cookie-btn--accept {
    background: var(--pk-cookie-primary);
    color: var(--pk-cookie-white);
}

.pk-cookie-btn--accept:hover {
    background: var(--pk-cookie-primary-hover);
    transform: translateY(-1px);
}

.pk-cookie-btn--reject {
    background: var(--pk-cookie-light);
    color: var(--pk-cookie-dark);
    border: 1px solid var(--pk-cookie-border);
}

.pk-cookie-btn--reject:hover {
    background: var(--pk-cookie-border);
}

.pk-cookie-btn--settings {
    background: transparent;
    color: var(--pk-cookie-dark);
    border: 1px solid var(--pk-cookie-border);
}

.pk-cookie-btn--settings:hover {
    border-color: var(--pk-cookie-primary);
    color: var(--pk-cookie-primary);
}

/* ============================================
   Settings Modal
   ============================================ */
.pk-cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--pk-cookie-font);
}

.pk-cookie-modal[hidden] {
    display: none;
}

.pk-cookie-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: pkFadeIn 0.2s ease-out;
}

@keyframes pkFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pk-cookie-modal__dialog {
    position: relative;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    background: var(--pk-cookie-white);
    border-radius: var(--pk-cookie-radius);
    box-shadow: var(--pk-cookie-shadow);
    display: flex;
    flex-direction: column;
    animation: pkScaleIn 0.2s ease-out;
}

@keyframes pkScaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.pk-cookie-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--pk-cookie-border);
}

.pk-cookie-modal__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--pk-cookie-dark);
    margin: 0;
}

.pk-cookie-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--pk-cookie-light);
    border: none;
    border-radius: 50%;
    color: var(--pk-cookie-gray);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pk-cookie-modal__close:hover {
    background: var(--pk-cookie-border);
    color: var(--pk-cookie-dark);
}

.pk-cookie-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.pk-cookie-modal__intro {
    font-size: 14px;
    line-height: 1.6;
    color: var(--pk-cookie-gray);
    margin: 0 0 20px 0;
}

.pk-cookie-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--pk-cookie-border);
    background: var(--pk-cookie-light);
    border-radius: 0 0 var(--pk-cookie-radius) var(--pk-cookie-radius);
}

/* ============================================
   Cookie Categories
   ============================================ */
.pk-cookie-category {
    padding: 16px;
    background: var(--pk-cookie-light);
    border-radius: var(--pk-cookie-radius-sm);
    margin-bottom: 12px;
}

.pk-cookie-category:last-child {
    margin-bottom: 0;
}

.pk-cookie-category__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.pk-cookie-category__info {
    flex: 1;
}

.pk-cookie-category__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--pk-cookie-dark);
    margin: 0 0 4px 0;
}

.pk-cookie-category__desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--pk-cookie-gray);
    margin: 0;
}

.pk-cookie-category__badge {
    flex-shrink: 0;
    padding: 4px 10px;
    background: #10b981;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   Toggle Switch
   ============================================ */
.pk-cookie-toggle {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    cursor: pointer;
}

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

.pk-cookie-toggle__slider {
    width: 48px;
    height: 26px;
    background: var(--pk-cookie-border);
    border-radius: 13px;
    transition: all 0.2s ease;
    position: relative;
}

.pk-cookie-toggle__slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pk-cookie-toggle input:checked + .pk-cookie-toggle__slider {
    background: var(--pk-cookie-primary);
}

.pk-cookie-toggle input:checked + .pk-cookie-toggle__slider::after {
    transform: translateX(22px);
}

.pk-cookie-toggle input:focus + .pk-cookie-toggle__slider {
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

/* ============================================
   Floating Button
   ============================================ */
.pk-cookie-float {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999;
    width: 44px;
    height: 44px;
    background: var(--pk-cookie-dark);
    color: var(--pk-cookie-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.pk-cookie-float[hidden] {
    display: none;
}

.pk-cookie-float:hover {
    background: var(--pk-cookie-primary);
    transform: scale(1.1);
}

.pk-cookie-float svg {
    transition: transform 0.3s ease;
}

.pk-cookie-float:hover svg {
    transform: rotate(90deg);
}

/* ============================================
   Body States
   ============================================ */
body.pk-modal-open {
    overflow: hidden;
}

body.pk-cookie-banner-visible {
    padding-bottom: 100px; /* Space for banner */
}

/* ============================================
   Accessibility
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.pk-cookie-btn:focus,
.pk-cookie-modal__close:focus,
.pk-cookie-float:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.3);
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 640px) {
    .pk-cookie-banner__container {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }

    .pk-cookie-banner__actions {
        flex-direction: column;
    }

    .pk-cookie-btn {
        width: 100%;
    }

    .pk-cookie-modal__dialog {
        width: 95%;
        max-height: 85vh;
    }

    .pk-cookie-modal__header,
    .pk-cookie-modal__body,
    .pk-cookie-modal__footer {
        padding: 16px;
    }

    .pk-cookie-modal__footer {
        flex-direction: column;
    }

    .pk-cookie-modal__footer .pk-cookie-btn {
        width: 100%;
    }

    .pk-cookie-category__header {
        flex-direction: column;
        gap: 12px;
    }

    .pk-cookie-float {
        bottom: 16px;
        left: 16px;
        width: 40px;
        height: 40px;
    }

    body.pk-cookie-banner-visible {
        padding-bottom: 200px;
    }
}

/* ============================================
   Print - Hide cookie elements
   ============================================ */
@media print {
    .pk-cookie-banner,
    .pk-cookie-modal,
    .pk-cookie-float {
        display: none !important;
    }
}
