/* Enhanced Cookie Consent System Styles */

/* Cookie Banner Styles */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    color: white;
    padding: 1.5rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 3px solid #667eea;
}

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

.cookie-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.cookie-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.cookie-text {
    flex: 1;
    min-width: 0; /* Prevent overflow issues */
}

.cookie-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    color: white;
    font-weight: 700;
}

.cookie-text p {
    margin: 0;
    opacity: 0.9;
    line-height: 1.5;
    font-size: 0.95rem;
}

.cookie-buttons {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.cookie-buttons button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.cookie-buttons button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.cookie-buttons button:hover::before {
    left: 100%;
}

.btn-accept-all {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn-accept-all:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.btn-customize {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-customize:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-decline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
}

.btn-decline:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-1px);
}

/* Cookie Modal Styles */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
}

.cookie-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    animation: overlayFadeIn 0.3s ease-out;
}

@keyframes overlayFadeIn {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to { opacity: 1; backdrop-filter: blur(4px); }
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 650px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

.cookie-category {
    margin-bottom: 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    border-color: #cbd5e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-bottom: 1px solid #e2e8f0;
}

.category-info h3 {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 700;
}

.category-info p {
    margin: 0;
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.5;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
    appearance: none;
    width: 56px;
    height: 28px;
    background: #cbd5e0;
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-switch input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 0 0 3px rgba(72, 187, 120, 0.1);
}

.toggle-switch input[type="checkbox"]:disabled {
    cursor: not-allowed;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    opacity: 0.7;
}

.toggle-switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.toggle-switch input[type="checkbox"]:checked::before {
    transform: translateX(28px);
}

.toggle-switch.disabled label {
    font-size: 0.8rem;
    color: #4a5568;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.category-details {
    padding: 2rem;
    background: white;
}

.category-details p {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.category-details strong {
    color: #2d3748;
    font-weight: 600;
}

.category-details a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.category-details a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

.privacy-links {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.privacy-links p {
    margin: 0;
    font-size: 0.9rem;
    color: #4a5568;
}

.privacy-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.privacy-links a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-top: 1px solid #e2e8f0;
}

.modal-footer button {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.modal-footer button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.modal-footer button:hover::before {
    left: 100%;
}

.btn-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-save:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-accept-all-modal {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn-accept-all-modal:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .cookie-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }
    
    .cookie-buttons button {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1.5rem;
    }
    
    .category-header {
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
    }
    
    .toggle-switch {
        justify-content: space-between;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .cookie-banner {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .cookie-text h3 {
        font-size: 1.1rem;
    }
    
    .cookie-text p {
        font-size: 0.9rem;
    }
    
    .cookie-buttons button {
        padding: 0.65rem 1.25rem;
        font-size: 0.85rem;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .category-info h3 {
        font-size: 1.1rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .cookie-icon {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-banner {
        border-top-width: 5px;
    }
    
    .cookie-buttons button {
        border: 2px solid currentColor;
    }
    
    .toggle-switch input[type="checkbox"] {
        border: 2px solid currentColor;
    }
}

/* Focus styles for accessibility */
.cookie-buttons button:focus,
.modal-close:focus,
.modal-footer button:focus,
.toggle-switch input[type="checkbox"]:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .cookie-banner,
    .cookie-modal {
        display: none !important;
    }
}