/* ==========================================================================
   CCRI Privacy Choices / Cookie Consent Styling
   Scoped specifically to #ccri-cookie-consent and #ccri-consent-badge
   Styled strictly as per CCRI / e-Kutir project theme:
   - Primary Color: var(--p-color, #126e9f)
   - Secondary / Action Button Color: var(--s-color, #f49431)
   - Typography: 'nunito-sans.regular', 'nunito-sans.semibold', 'nunito-sans.bold'
   ========================================================================== */

/* Persistent Floating Badge Button */
.ccri-consent-badge {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--p-color, #126e9f);
    color: #ffffff !important;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-family: 'nunito-sans.semibold', 'Nunito Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(18, 110, 159, 0.35);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.ccri-consent-badge:hover,
.ccri-consent-badge:focus {
    background-color: #105b73;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 91, 115, 0.45);
    outline: none;
}

.ccri-consent-badge:focus-visible {
    outline: 2px solid var(--p-color, #126e9f);
    outline-offset: 2px;
}

.ccri-badge-icon {
    flex-shrink: 0;
}

.ccri-badge-text {
    line-height: 1;
}

/* Main Consent Banner Container */
.ccri-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    background-color: #ffffff;
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.16);
    border-top: 3px solid var(--p-color, #126e9f);
    border-radius: 8px 8px 0 0;
    max-height: 85vh;
    overflow-y: auto;
    font-family: 'nunito-sans.regular', 'Nunito Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    color: var(--tb-color, #020202);
    font-size: 14px;
    line-height: 1.5;
    animation: ccriSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-overflow-scrolling: touch;
}

@keyframes ccriSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ccri-consent-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 22px 30px 20px 30px;
}

/* Header Area */
.ccri-consent-header {
    margin-bottom: 10px;
}

.ccri-consent-title {
    font-family: 'nunito-sans.bold', 'Nunito Sans', sans-serif !important;
    font-size: 19px;
    font-weight: 700;
    color: var(--p-color, #126e9f);
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

/* Body & Explanatory Text */
.ccri-consent-body {
    margin-bottom: 14px;
}

.ccri-consent-text {
    font-size: 13.5px;
    line-height: 1.55;
    color: #374151;
    margin: 0 0 12px 0;
}

.ccri-consent-summary {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.ccri-summary-heading {
    font-family: 'nunito-sans.semibold', 'Nunito Sans', sans-serif !important;
    font-size: 13px;
    font-weight: 600;
    color: var(--tb-color, #020202);
    margin: 0 0 6px 0;
}

.ccri-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ccri-summary-list li {
    font-size: 12.5px;
    line-height: 1.5;
    color: #4b5563;
    margin-bottom: 4px;
}

.ccri-summary-list li:last-child {
    margin-bottom: 0;
}

/* Links */
.ccri-consent-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 8px;
    margin-bottom: 4px;
}

.ccri-link {
    font-family: 'nunito-sans.semibold', 'Nunito Sans', sans-serif !important;
    color: var(--p-color, #126e9f) !important;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: underline !important;
    transition: color 0.15s ease;
}

.ccri-link:hover,
.ccri-link:focus {
    color: #105b73 !important;
    text-decoration: underline !important;
}

/* Preferences Panel */
.ccri-preferences-panel {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    margin-top: 12px;
    margin-bottom: 16px;
}

.ccri-prefs-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.ccri-link-btn {
    background: none;
    border: none;
    color: var(--p-color, #126e9f);
    font-family: 'nunito-sans.semibold', 'Nunito Sans', sans-serif !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 2px 4px;
}

.ccri-link-btn:hover,
.ccri-link-btn:focus {
    color: #105b73;
}

.ccri-categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ccri-category-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ccri-category-card:hover {
    border-color: #cbd5e1;
}

.ccri-category-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ccri-category-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.ccri-category-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--p-color, #126e9f);
    margin: 0;
}

.ccri-category-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.85;
}

.ccri-category-title {
    font-family: 'nunito-sans.bold', 'Nunito Sans', sans-serif !important;
    font-size: 14.5px;
    font-weight: 700;
    color: #111827;
}

.ccri-toggle-desc-btn {
    background: none;
    border: none;
    padding: 2px 0 0 27px;
    color: #6b7280;
    font-family: 'nunito-sans.regular', 'Nunito Sans', sans-serif !important;
    font-size: 12.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    transition: color 0.15s ease;
}

.ccri-toggle-desc-btn:hover,
.ccri-toggle-desc-btn:focus {
    color: #111827;
    outline: none;
}

.ccri-chevron {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.ccri-toggle-desc-btn[aria-expanded="true"] .ccri-chevron {
    transform: rotate(180deg);
}

.ccri-category-desc {
    background-color: #f9fafb;
    border-radius: 4px;
    padding: 10px 14px;
    margin-top: 8px;
    margin-left: 27px;
    border-top: 1px solid #f3f4f6;
}

.ccri-category-desc p {
    font-size: 13px;
    line-height: 1.5;
    color: #374151;
    margin: 0 0 6px 0;
}

.ccri-category-desc p:last-child {
    margin-bottom: 0;
}

.ccri-desc-sub {
    font-size: 12px !important;
    color: #6b7280 !important;
}

/* Action Buttons Toolbar */
.ccri-consent-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.ccri-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'nunito-sans.semibold', 'Nunito Sans', sans-serif !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    padding: 7px 22px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    text-align: center;
    white-space: nowrap;
}

/* Outlined buttons: "Manage preferences", "Reject all", "Hide preferences", "Cancel"
   Uses project primary theme blue: var(--p-color, #126e9f) */
.ccri-btn-outline {
    background-color: #ffffff !important;
    border: 1.5px solid var(--p-color, #126e9f) !important;
    color: var(--p-color, #126e9f) !important;
}

.ccri-btn-outline:hover,
.ccri-btn-outline:focus {
    background-color: #eef6fa !important;
    border-color: #105b73 !important;
    color: #105b73 !important;
    outline: none !important;
}

.ccri-btn-outline:focus-visible {
    outline: 2px solid var(--p-color, #126e9f) !important;
    outline-offset: 2px;
}

/* Solid action buttons: "Accept all", "Save preferences"
   Matches the portal's prominent action button color: var(--s-color, #f49431)
   (Same color as Login, Employee Login, GRIMCO Login, Organization Login) */
.ccri-btn-action,
.ccri-btn-teal {
    background-color: var(--s-color, #f49431) !important;
    border: 1.5px solid var(--s-color, #f49431) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(244, 148, 49, 0.3);
}

.ccri-btn-action:hover,
.ccri-btn-action:focus,
.ccri-btn-teal:hover,
.ccri-btn-teal:focus {
    background-color: #d37c22 !important;
    border-color: #d37c22 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(211, 124, 34, 0.4);
    outline: none !important;
}

.ccri-btn-action:focus-visible,
.ccri-btn-teal:focus-visible {
    outline: 2px solid var(--s-color, #f49431) !important;
    outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ccri-consent-banner {
        max-height: 90vh;
        border-radius: 6px 6px 0 0;
    }

    .ccri-consent-container {
        padding: 16px 16px 16px 16px;
    }

    .ccri-consent-title {
        font-size: 17px;
    }

    .ccri-consent-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .ccri-btn {
        width: 100%;
        padding: 9px 16px;
    }

    .ccri-consent-badge {
        bottom: 12px;
        left: 12px;
        padding: 6px 12px;
        font-size: 12px;
    }
}
