/* Cookie Banner Styles */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-top: 3px solid #DC143C;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    z-index: 9999;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.cookie-banner.show {
    transform: translateY(0);
    opacity: 1;
}

.cookie-banner.hide {
    transform: translateY(100%);
    opacity: 0;
}

/* Force separation between text and buttons */
.cookie-banner .row:first-child {
    margin-bottom: 1.5rem !important;
    display: block !important;
    width: 100% !important;
}

.cookie-banner .row:last-child {
    display: block !important;
    width: 100% !important;
    clear: both !important;
}

/* Ensure proper text wrapping and button alignment */
.cookie-banner .row {
    align-items: flex-start;
}

.cookie-banner .d-flex.align-items-start {
    width: 100%;
}

.cookie-banner .flex-shrink-0 {
    flex-shrink: 0;
}

.cookie-banner .flex-grow-1 {
    flex-grow: 1;
    min-width: 0; /* Allows text to wrap properly */
}

.cookie-banner .d-flex.flex-column.flex-sm-row {
    width: 100%;
}

@media (min-width: 992px) {
    .cookie-banner .d-flex.flex-column.flex-sm-row {
        flex-direction: row !important;
        gap: 0.75rem !important;
        justify-content: flex-end !important;
    }
    
    .cookie-banner .btn {
        width: auto !important;
        white-space: nowrap;
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
        min-width: 140px;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .cookie-banner .d-flex.flex-column.flex-sm-row {
        flex-direction: row !important;
        gap: 0.75rem !important;
        justify-content: center !important;
    }
    
    .cookie-banner .btn {
        flex: 1;
        max-width: 160px;
    }
}

.cookie-banner-content {
    padding: 1.5rem 0;
    min-height: auto;
}

.cookie-banner .container {
    max-width: 1200px;
}

.cookie-banner .row {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    flex-direction: column !important;
}

.cookie-banner .row + .row {
    margin-top: 1rem;
}

/* Force text section to take full width */
.cookie-banner .row:first-child .col-12 {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Force button section to take full width and be below text */
.cookie-banner .row:last-child .col-12 {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 1rem !important;
}

/* Specific styling for cookie banner sections */
.cookie-banner .cookie-text-row {
    margin-bottom: 1.5rem !important;
    display: block !important;
}

.cookie-banner .cookie-button-row {
    display: block !important;
    margin-top: 1rem !important;
}

.cookie-banner h6 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.cookie-banner p {
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 0;
}

.cookie-banner .btn {
    white-space: nowrap;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    min-width: 120px;
    font-size: 0.95rem;
}

.cookie-banner .btn-outline-secondary {
    border-color: #6c757d;
    color: #495057;
    background-color: #fff;
    border-width: 2px;
}

.cookie-banner .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.cookie-banner .btn-warning {
    background-color: #DC143C;
    border-color: #DC143C;
    color: white;
    font-weight: 600;
}

.cookie-banner .btn-warning:hover {
    background-color: #B91C3C;
    border-color: #B91C3C;
    color: white;
    transform: translateY(-1px);
}

.cookie-banner .btn-success {
    background-color: #198754;
    border-color: #198754;
    font-weight: 600;
}

.cookie-banner .btn-success:hover {
    background-color: #157347;
    border-color: #157347;
    transform: translateY(-1px);
}

/* Cookie Settings Modal Styles */
.cookie-category {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    border-left: 4px solid #f5c74d;
}

.cookie-category h6 {
    color: #2c3e50;
}

.cookie-category .text-muted {
    font-size: 0.875rem;
    line-height: 1.4;
}

.form-switch .form-check-input {
    width: 2rem;
    height: 1rem;
    background-color: #dee2e6;
    border: none;
    border-radius: 2rem;
}

.form-switch .form-check-input:checked {
    background-color: #198754;
}

.form-switch .form-check-input:disabled {
    background-color: #198754;
    opacity: 0.7;
}

/* Cookie Toast Messages */
.cookie-toast {
    position: fixed;
    top: 100px;
    right: 20px;
    min-width: 300px;
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
    border-radius: 0.5rem;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cookie-toast .btn-close {
    padding: 0.5rem;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .cookie-banner-content {
        padding: 1.5rem 0;
    }
    
    .cookie-banner .btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .cookie-banner .d-flex.flex-column.flex-sm-row {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
}

@media (max-width: 767.98px) {
    .cookie-banner-content {
        padding: 1.25rem 0;
    }
    
    .cookie-banner h6 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .cookie-banner p {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    .cookie-banner .btn {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        min-height: 48px;
        width: 100%;
    }
    
    .cookie-banner .d-flex.flex-column.flex-sm-row {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .cookie-toast {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

@media (max-width: 575.98px) {
    .cookie-banner-content {
        padding: 1rem 0;
    }
    
    .cookie-banner .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .cookie-banner h6 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .cookie-banner p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .cookie-banner .btn {
        padding: 0.875rem 0.75rem;
        font-size: 0.95rem;
        min-height: 48px;
        width: 100%;
    }
    
    .cookie-banner .d-flex.flex-column.flex-sm-row {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
}

/* Accessibility */
.cookie-banner:focus-within {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}

.cookie-banner .btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(245, 199, 77, 0.25);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-banner {
        border-top-width: 4px;
        border-top-color: #DC143C;
    }
    
    .cookie-banner h6 {
        color: #000;
    }
    
    .cookie-banner p {
        color: #333;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner {
        transition: none;
    }
    
    .cookie-toast {
        animation: none;
    }
    
    .cookie-banner .btn {
        transition: none;
    }
}
