/**
 * Super Cookie Notice Pro Styles
 * Version: 1.1.1 (Fix FOUC)
 */

/* Banner Container */
.scnp-cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 1.5rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 999999;
    /* Animation settings */
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.scnp-cookie-banner.scnp-position-bottom { bottom: 0; }

.scnp-cookie-banner.scnp-position-top {
    top: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-100%);
}

/* FIX: Stronger hidden state */
.scnp-cookie-banner.scnp-hidden { 
    display: none !important; 
    opacity: 0 !important;
    animation: none !important;
    pointer-events: none !important;
}

@keyframes slideIn { to { transform: translateY(0); } }

/* Banner Content */
.scnp-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.scnp-banner-message {
    flex: 1 1 300px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e5e7eb;
}

.scnp-banner-message a {
    color: #60a5fa;
    text-decoration: underline;
    transition: color 0.2s;
}

.scnp-banner-message a:hover { color: #93c5fd; }

/* Button Group */
.scnp-button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Button Styles */
.scnp-btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.scnp-btn-primary {
    background: var(--scnp-primary-color, #4F46E5);
    color: #fff;
}

.scnp-btn-primary:hover {
    background: var(--scnp-primary-hover, #4338CA);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.scnp-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.scnp-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.scnp-btn-tertiary {
    background: transparent;
    color: var(--scnp-reject-color, #9ca3af);
    padding: 0.625rem 1rem;
}

.scnp-btn-tertiary:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Modal Overlay */
.scnp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.scnp-modal-overlay.scnp-active { display: flex; }

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

/* Modal Container */
.scnp-modal {
    background: #fff;
    border-radius: 1rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Modal Header */
.scnp-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scnp-modal-title { font-size: 1.25rem; font-weight: 700; color: #111827; margin: 0; }

.scnp-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}

.scnp-modal-close:hover { color: #111827; background: #f3f4f6; }

/* Modal Body */
.scnp-modal-body { padding: 1.5rem; }

.scnp-modal-description { font-size: 0.875rem; color: #6b7280; margin-bottom: 1.5rem; line-height: 1.6; }

/* Cookie Category */
.scnp-cookie-category {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.scnp-cookie-category:hover { border-color: #d1d5db; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); }

.scnp-category-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }

.scnp-category-title { font-weight: 600; color: #111827; font-size: 1rem; margin: 0; }

.scnp-category-description { font-size: 0.875rem; color: #6b7280; line-height: 1.5; margin: 0; }

/* Toggle Switch */
.scnp-toggle-switch { position: relative; display: inline-block; width: 48px; height: 24px; }
.scnp-toggle-switch input { opacity: 0; width: 0; height: 0; }
.scnp-toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #d1d5db; transition: 0.3s; border-radius: 24px; }
.scnp-toggle-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: 0.3s; border-radius: 50%; }
.scnp-toggle-switch input:checked + .scnp-toggle-slider { background-color: var(--scnp-primary-color, #4F46E5); }
.scnp-toggle-switch input:checked + .scnp-toggle-slider:before { transform: translateX(24px); }
.scnp-toggle-switch input:disabled + .scnp-toggle-slider { cursor: not-allowed; opacity: 0.5; }

/* Modal Footer */
.scnp-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.scnp-modal-footer .scnp-btn { min-width: 120px; }

/* Settings Link Button */
.scnp-settings-link, #scnp-open-settings {
    background: var(--scnp-primary-color, #4F46E5);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.scnp-settings-link:hover, #scnp-open-settings:hover {
    background: var(--scnp-primary-hover, #4338CA);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .scnp-banner-content { flex-direction: column; gap: 1.25rem; text-align: center; }
    .scnp-banner-message { flex: 1 1 100%; }
    .scnp-button-group { width: 100%; flex-direction: column; }
    .scnp-btn { width: 100%; justify-content: center; }
    .scnp-modal { margin: 1rem; max-height: calc(100vh - 2rem); }
    .scnp-modal-footer { flex-direction: column; }
    .scnp-modal-footer .scnp-btn { width: 100%; }
}

@media (max-width: 480px) {
    .scnp-cookie-banner { padding: 1rem; }
    .scnp-banner-message { font-size: 0.875rem; }
    .scnp-btn { font-size: 0.8125rem; padding: 0.5rem 1rem; }
    .scnp-modal-header, .scnp-modal-body, .scnp-modal-footer { padding: 1rem; }
}
