/* Cookie Banner & Modal Styles - Matching User Reference */

:root {
    --cc-primary: #3b82f6; /* Blue matching screenshot */
    --cc-primary-hover: #2563eb;
    --cc-text: #374151; /* Dark gray */
    --cc-text-muted: #6b7280; /* Lighter gray */
    --cc-bg: #ffffff;
    --cc-border: #e5e7eb; /* Light border */
    --cc-overlay: rgba(0, 0, 0, 0.4);
    --cc-active: #16a34a; /* Green for Always Active */
    --cc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Bottom Banner */
#cookie-banner-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--cc-bg);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
    z-index: 9998;
    padding: 16px 24px;
    display: none; /* hidden by default until JS logic runs */
    font-family: var(--cc-font);
    border-top: 1px solid var(--cc-border);
}

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

.cb-container {
    max-width: 1200px;
    margin: 0 auto;
}

.cb-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
}

.cb-content-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.cb-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    color: var(--cc-text);
    margin: 0;
}

.cb-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cb-btn {
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    border: 1px solid transparent !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    min-width: 100px;
    height: 42px;
}

.cb-btn-outline {
    border-color: #d1d5db !important;
    color: #374151 !important;
}

.cb-btn-outline:hover {
    background-color: #f9fafb !important;
    border-color: #9ca3af !important;
}

.cb-btn-primary {
    background-color: #2b388f !important; /* Arryasys Blue */
    color: #ffffff !important;
    border-color: #2b388f !important;
}

.cb-btn-primary:hover {
    background-color: #1a237e !important;
    border-color: #1a237e !important;
}

/* Highlight for selected choice */
.cb-btn.selected {
    background-color: #2b388f !important; /* Arryasys Blue */
    color: #ffffff !important;
    border-color: #2b388f !important;
    box-shadow: 0 0 0 2px rgba(43, 56, 143, 0.2);
}

/* Modal Overlay */
#cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--cc-overlay);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: var(--cc-font);
}

#cookie-modal-overlay.show {
    display: flex;
}

/* Modal Box */
.cm-box {
    background-color: var(--cc-bg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.cm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--cc-border);
}

.cm-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.cm-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--cc-text-muted);
    cursor: pointer;
    line-height: 1;
}

.cm-close:hover {
    color: #111827;
}

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

.cm-intro {
    font-size: 13px;
    color: var(--cc-text);
    margin-top: 0;
    margin-bottom: 16px;
}

/* Accordion */
.cm-accordion {
    border-top: 1px solid var(--cc-border);
}

.cm-accordion-item {
    border-bottom: 1px solid var(--cc-border);
}

.cm-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    cursor: pointer;
}

.cm-accordion-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}

.cm-accordion-icon {
    font-size: 10px;
    transition: transform 0.2s ease;
    color: var(--cc-text-muted);
}

.cm-accordion-item.active .cm-accordion-icon {
    transform: rotate(90deg);
}

.cm-status {
    font-size: 12px;
    font-weight: 600;
}

.cm-status.active-text {
    color: var(--cc-active);
}

.cm-accordion-content {
    display: none;
    padding: 0 0 16px 0;
    font-size: 13px;
    color: var(--cc-text);
    line-height: 1.6;
}

.cm-accordion-item.active .cm-accordion-content {
    display: block;
}

/* Cookie Details Box (Matching user screenshot) */
.cm-cookie-box {
    margin-top: 12px;
    background: #f9fafb;
    border-radius: 6px;
    padding: 16px;
}

.cm-cookie-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    margin-bottom: 8px;
}

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

.cm-cookie-label {
    font-weight: 700;
    color: #4b5563;
    font-size: 12px;
}

.cm-cookie-value {
    color: #4b5563;
    font-size: 12px;
}

.cm-no-cookies {
    margin-top: 12px;
    background: #f9fafb;
    border-radius: 6px;
    padding: 16px;
    color: #4b5563;
    font-size: 12px;
    font-style: italic;
}

/* Toggle Switch */
.cm-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

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

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

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

input:checked + .cm-slider {
    background-color: var(--cc-primary);
}

input:checked + .cm-slider:before {
    transform: translateX(16px);
}

/* Modal Footer */
.cm-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--cc-border);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    background: #f9fafb;
    border-radius: 0 0 8px 8px;
}

.cm-btn-save {
    color: var(--cc-primary);
    border-color: var(--cc-primary);
    flex: 1;
}

.cm-btn-save:hover {
    background-color: #eff6ff;
}

.cm-footer .cb-btn {
    flex: 1;
    text-align: center;
}

/* Floating Edit Button */
#cookie-floating-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--cc-bg);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9997;
    border: 1px solid var(--cc-border);
}

#cookie-floating-btn.show {
    display: flex;
}

@media (max-width: 768px) {
    .cb-content-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .cb-actions {
        width: 100%;
        justify-content: space-between;
    }
    .cb-btn {
        flex: 1;
        text-align: center;
    }
    .cm-footer {
        flex-direction: column;
    }
}
