/* ========================================
   COOKIE CONSENT - BANNER & MODAL STYLES
   CodeNest Modern Design - GDPR-compliant
   ======================================== */

/* ========================================
   COLOR VARIABLES - CodeNest Brand Colors
   ======================================== */
:root {
    --cn-primary: #3B82F6;
    --cn-primary-dark: #2563EB;
    --cn-primary-light: #EFF6FF;
    --cn-text-dark: #111315;
    --cn-text-light: #6B7280;
    --cn-border: #E5E7EB;
    --cn-bg-light: #F9FAFB;
}

/* ========================================
   COOKIE BANNER (Modern Popup)
   ======================================== */

.cookie-banner {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    animation: fadeIn 0.3s ease;
}

.cookie-banner.show {
    display: flex;
}

.cookie-banner-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    cursor: default;
}

.cookie-banner-content {
    position: relative;
    background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(59, 130, 246, 0.1);
    max-width: 650px;
    width: 100%;
    padding: 2.5rem;
    z-index: 100000;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Header with icon */
.cookie-banner-text {
    margin-bottom: 1.5rem;
}

.cookie-banner-text h3 {
    font-size: 1.5rem;
    color: var(--cn-text-dark);
    margin-bottom: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cookie-banner-text h3::before {
    content: "🍪";
    font-size: 1.75rem;
}

.cookie-banner-text p {
    color: var(--cn-text-light);
    line-height: 1.7;
    margin-bottom: 0;
    font-size: 0.95rem;
}

.cookie-banner-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ========================================
   COOKIE BUTTONS - Modern Design
   ======================================== */

.btn-cookie {
    padding: 0.75rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 0.75rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.btn-cookie:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Primary Button - Accept All */
.btn-primary {
    background: linear-gradient(135deg, var(--cn-primary) 0%, var(--cn-primary-dark) 100%);
    color: #FFFFFF;
    border-color: var(--cn-primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--cn-primary-dark) 0%, #1d4ed8 100%);
    border-color: var(--cn-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button - Settings */
.btn-secondary {
    background-color: transparent;
    color: var(--cn-primary);
    border-color: var(--cn-primary);
    font-weight: 600;
}

.btn-secondary:hover {
    background-color: var(--cn-primary-light);
    border-color: var(--cn-primary-dark);
    color: var(--cn-primary-dark);
    transform: translateY(-1px);
}

/* Outline Button - Reject */
.btn-outline {
    background-color: transparent;
    color: var(--cn-text-light);
    border-color: var(--cn-border);
}

.btn-outline:hover {
    background-color: var(--cn-bg-light);
    border-color: var(--cn-text-light);
    color: var(--cn-text-dark);
}.btn-primary:hover {
    background-color: #2563EB;
    border-color: #2563EB;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: #111315;
    border-color: #D1D5DB;
}

.btn-secondary:hover {
    background-color: #F3F4F6;
    border-color: #9CA3AF;
}

/* ========================================
   COOKIE MODAL (Settings)
   ======================================== */

.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cookie-modal.show {
    display: flex;
}

.cookie-modal-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    cursor: pointer;
}

.cookie-modal-content {
    position: relative;
    background-color: #FFFFFF;
    border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    max-width: 650px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 100001;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Modal Header */
.cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 2px solid #F3F4F6;
}

.cookie-modal-header h2 {
    font-size: 1.5rem;
    color: #111315;
    margin: 0;
    font-weight: 700;
}

.cookie-modal-close {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #6B7280;
    transition: color 0.2s ease;
    border-radius: 0.5rem;
}

.cookie-modal-close:hover {
    color: #111315;
    background-color: #F3F4F6;
}

.cookie-modal-close:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Modal Body */
.cookie-modal-body {
    padding: 2rem;
}

.cookie-modal-description {
    color: #6B7280;
    line-height: 1.6;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Cookie Options */
.cookie-option {
    border-bottom: 1px solid #F3F4F6;
    padding: 1.5rem 0;
}

.cookie-option:last-child {
    border-bottom: none;
}

.cookie-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.cookie-option h3 {
    font-size: 1.1rem;
    color: #111315;
    margin: 0 0 0.25rem 0;
    font-weight: 600;
}

.cookie-always-active {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #DBEAFE;
    color: #1E40AF;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.cookie-option p {
    color: #6B7280;
    line-height: 1.6;
    margin: 0;
    font-size: 0.9rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #D1D5DB;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: #FFFFFF;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #3B82F6;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Modal Info Section */
.cookie-modal-info {
    padding: 1rem 2rem;
    background: rgba(59, 130, 246, 0.05);
    border-top: 1px solid var(--cn-border);
    border-bottom: 1px solid var(--cn-border);
}

.cookie-modal-info-text {
    margin: 0;
    font-size: 0.85rem;
    color: var(--cn-text-light);
    line-height: 1.6;
}

.cookie-modal-info-link {
    color: var(--cn-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--cn-primary);
}

.cookie-modal-info-link:hover {
    color: var(--cn-primary-dark);
    border-bottom-color: var(--cn-primary-dark);
}

.cookie-modal-info-link:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    border-radius: 2px;
}

/* Modal Footer */
.cookie-modal-footer {
    padding: 1.5rem 2rem 2rem;
    border-top: 1px solid var(--cn-border);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ========================================
   FOOTER COOKIE INDICATOR
   ======================================== */

#cookieStatusIndicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #1E293B;
}

.cookie-status-text {
    color: #94A3B8;
    font-size: 0.85rem;
}

.cookie-status-link {
    background: none;
    border: none;
    color: #3B82F6;
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
    font-family: inherit;
}

.cookie-status-link:hover {
    color: #60A5FA;
}

.cookie-status-link:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    border-radius: 2px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet */
@media (max-width: 768px) {
    .cookie-banner-content {
        padding: 1.5rem;
    }
    
    .cookie-banner-actions {
        flex-direction: column;
    }
    
    .btn-cookie {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-modal-content {
        max-height: 95vh;
    }
    
    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .cookie-modal-footer {
        flex-direction: column;
    }
    
    .cookie-modal-footer .btn-cookie {
        width: 100%;
    }
    
    .cookie-modal-info {
        padding: 0.75rem 1.5rem;
    }
    
    .cookie-modal-info-text {
        font-size: 0.8rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .cookie-banner-content {
        padding: 1.25rem;
    }
    
    .cookie-banner-text h3 {
        font-size: 1.25rem;
    }
    
    .cookie-banner-text p {
        font-size: 0.9rem;
    }
    
    .cookie-modal-header h2 {
        font-size: 1.25rem;
    }
    
    .cookie-option-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    #cookieStatusIndicator {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ========================================
   FIXED COOKIE SETTINGS BUTTON
   ======================================== */

.cookie-settings-btn-fixed {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cn-primary) 0%, var(--cn-primary-dark) 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.cookie-settings-btn-fixed.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cookie-settings-btn-fixed:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.cookie-settings-btn-fixed:active {
    transform: scale(0.95);
}

.cookie-settings-btn-fixed svg {
    display: block;
    width: 24px;
    height: 24px;
    color: currentColor;
}

/* ========================================
   MOBILE RESPONSIVE - FIXED BUTTON
   ======================================== */

@media (max-width: 480px) {
    .cookie-settings-btn-fixed {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .cookie-banner,
    .cookie-modal,
    #cookieStatusIndicator,
    .cookie-settings-btn-fixed {
        display: none !important;
    }
}