/* ========================================
   GDPR Cookie Consent Styles
   Modern SaaS Design for Real Estate Website
   ======================================== */

* {
    box-sizing: border-box;
}

/* Demo Content Styling */
.demo-content {
    padding: 40px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ========================================
   Cookie Banner
   ======================================== */

.cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    max-width: 420px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    animation: slideInUp 0.4s ease-out;
    display: none; /* Hidden by default, shown by JS */
}

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

.cookie-banner.show {
    display: block;
}

.cookie-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cookie-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

.cookie-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #4a5568;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
}

.btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
    flex: 1;
    min-width: 120px;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.btn-block {
    width: 100%;
}

/* ========================================
   Modal
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 540px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f3f4f6;
    color: #1a1a1a;
}

.close-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-intro {
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.6;
    color: #4a5568;
}

.cookie-category {
    margin-bottom: 20px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.cookie-category:last-child {
    margin-bottom: 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.category-info {
    flex: 1;
}

.category-info h4 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.category-info p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
}

/* ========================================
   Toggle Switch
   ======================================== */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .slider {
    background-color: #2563eb;
}

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

.toggle-switch.disabled {
    opacity: 0.6;
}

.toggle-switch.disabled .slider {
    cursor: not-allowed;
    background-color: #94a3b8;
}

.toggle-switch input:focus-visible + .slider {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.modal-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid #e5e7eb;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .cookie-banner {
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        margin: 0;
    }

    .cookie-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .btn-primary {
        order: -1; /* Move Accept All to top on mobile */
    }

    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .toggle-switch {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .cookie-banner {
        padding: 20px;
    }

    .cookie-title {
        font-size: 16px;
    }

    .cookie-description {
        font-size: 13px;
    }

    .modal-header {
        padding: 20px 20px 12px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 12px 20px 20px;
    }
}

/* ========================================
   Accessibility
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .modal-overlay,
    .modal-content,
    .btn,
    .slider,
    .slider:before {
        animation: none;
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-banner,
    .modal-content {
        border: 2px solid #000;
    }

    .btn-primary {
        border: 2px solid #1d4ed8;
    }

    .btn-secondary {
        border: 2px solid #374151;
    }
}
