/* ================================
   COOKIE CONSENT POPUP
   Matches Sqlism Theme
   ================================ */

/* Smooth transitions for cookie popup */
.cookie-consent-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 20px;
    border-top: 1px solid #eee;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: none; /* Hidden by default */
}

body.dark-theme .cookie-consent-container {
    background: #1a1a1a;
    border-top: 1px solid #333;
}

.cookie-consent-container.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.cookie-text {
    flex: 1;
}

.cookie-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-title i {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.3rem;
}

.cookie-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.cookie-description a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
}

.cookie-description a:hover {
    color: var(--primary-dark);
}

.cookie-buttons {
    display: flex;
    gap: 15px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid transparent;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: 1px solid goldenrod;
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.cookie-btn-settings {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

.cookie-btn-settings:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.cookie-btn-deny {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.cookie-btn-deny:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Modal backdrop */
.cookie-settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

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

.cookie-settings-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-settings-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border: 2px solid var(--border);
    box-shadow: 0 10px 40px var(--shadow-lg);
    position: relative;
}

.cookie-settings-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cookie-settings-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.cookie-settings-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-settings-title i {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cookie-toggle-group {
    margin-bottom: 25px;
}

.cookie-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.cookie-toggle-info h4 {
    color: var(--text-primary);
    margin-bottom: 5px;
    font-size: 1rem;
}

.cookie-toggle-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

/* Toggle Switch - Matches Theme */
.cookie-toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

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

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, #d1d5db, #9ca3af);
    transition: .4s;
    border-radius: 34px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .cookie-toggle-slider {
    background: linear-gradient(to right, var(--primary), var(--secondary));
}

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

/* Required cookies are disabled */
.cookie-toggle-item.required .cookie-toggle-switch {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-toggle-item.required input {
    pointer-events: none;
}

/* Description */
.cookie-settings-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 25px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.cookie-settings-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

.cookie-settings-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid goldenrod;
}

.cookie-settings-save {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.cookie-settings-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.cookie-settings-cancel {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

.cookie-settings-cancel:hover {
    background: var(--bg-primary);
    border-color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    
    .cookie-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .cookie-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-settings-content {
        padding: 20px;
        margin: 10px;
    }
    
    .cookie-settings-buttons {
        flex-direction: column;
    }
    
    .cookie-settings-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Animation for initial appearance */
@keyframes cookieSlideIn {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cookie-consent-container.show {
    animation: cookieSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}