/* ==========================================================================
   Custom Cookie Consent Widget Styles
   Matches layout & reference images (Essential Block, Dynamic Height)
   ========================================================================== */

/* --- Bottom-Right Floating Card Container --- */
.cc-banner-floating-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto;
    transform: translateY(120%);
    width: 420px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    z-index: 999999;
    background: #000000;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #1f1f1f;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, visibility 0.35s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    color: #ffffff;
    overflow: hidden;
    height: auto;
    display: flex;
    flex-direction: column;
}

.cc-banner-floating-wrapper.cc-show {
    transform: translateY(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

/* --- In-Card Views Switching --- */
.cc-widget-view {
    display: none;
    width: 100%;
    box-sizing: border-box;
}

.cc-widget-view.cc-view-active {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
    height: 100%;
}

/* --- View 1: Main Banner View --- */
.cc-banner-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -ms-scroll-chaining: none;
    box-sizing: border-box;
}

.cc-banner-heading {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
}

.cc-banner-paragraph {
    font-size: 12.5px;
    color: #a1a1aa;
    line-height: 1.55;
    margin: 0;
}

.cc-banner-paragraph a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.cc-banner-paragraph a:hover {
    color: #e4e4e7;
}

/* Essential Cookies Block (Exact replica of reference image) */
.cc-banner-essential-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
    margin-bottom: 2px;
}

.cc-banner-essential-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cc-banner-essential-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.cc-banner-essential-subtext {
    font-size: 12.5px;
    color: #a1a1aa;
    line-height: 1.4;
    margin: 0;
}

.cc-always-on-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e6f4ea;
    color: #00875a;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 16px;
    width: fit-content;
    margin-top: 4px;
}

.cc-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.cc-btn-full {
    width: 100%;
}

.cc-banner-row-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cc-banner-row-buttons .cc-btn {
    flex: 1;
}

/* Button Variants */
.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
    line-height: 1.4;
}

.cc-btn-outline-dark {
    background: transparent;
    border: 1px solid #3f3f46;
    color: #ffffff;
}

.cc-btn-outline-dark:hover {
    background: #18181b;
    border-color: #52525b;
}

.cc-btn-white {
    background: #ffffff;
    border: 1px solid #ffffff;
    color: #000000;
}

.cc-btn-white:hover {
    background: #f4f4f5;
    border-color: #f4f4f5;
}

/* --- View 2 & View 3 Layout --- */
.cc-customize-container, .cc-details-container {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.cc-customize-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #000000;
    z-index: 20;
    padding: 20px 24px 12px 24px;
    flex-shrink: 0;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cc-customize-body, .cc-details-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -ms-scroll-chaining: none;
    padding: 16px 24px;
    box-sizing: border-box;
    min-height: 0;
}

.cc-details-body {
    padding-bottom: 24px;
}

.cc-customize-footer {
    padding: 12px 24px 20px 24px;
    background: #000000;
    flex-shrink: 0;
    box-sizing: border-box;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cc-category-icon-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cc-category-icon-badge.icon-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.cc-category-icon-badge.icon-indigo {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.cc-category-icon-badge.icon-green {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.cc-category-icon-badge.icon-amber {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.cc-category-icon-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: block;
}

.cc-btn-back {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
    margin-left: -6px;
}

.cc-btn-back:hover {
    background: #27272a;
}

.cc-customize-intro {
    font-size: 12px;
    color: #a1a1aa;
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.cc-confirm-note {
    font-size: 11.5px;
    color: #a1a1aa;
    font-style: italic;
    margin: 6px 0 12px 0;
    line-height: 1.45;
    text-align: center;
}

.cc-confirm-note a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 500;
}

.cc-confirm-note a:hover {
    color: #38bdf8;
}

/* Category List (Expands naturally inside scrollable body) */
.cc-category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

/* Dark Custom Scrollbar for scrollable bodies */
.cc-banner-container::-webkit-scrollbar,
.cc-customize-body::-webkit-scrollbar,
.cc-details-body::-webkit-scrollbar {
    width: 5px;
}

.cc-banner-container::-webkit-scrollbar-track,
.cc-customize-body::-webkit-scrollbar-track,
.cc-details-body::-webkit-scrollbar-track {
    background: transparent;
}

.cc-banner-container::-webkit-scrollbar-thumb,
.cc-customize-body::-webkit-scrollbar-thumb,
.cc-details-body::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 4px;
}

.cc-banner-container::-webkit-scrollbar-thumb:hover,
.cc-customize-body::-webkit-scrollbar-thumb:hover,
.cc-details-body::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

/* Category Cards in Customize View */
.cc-category-card {
    background: #121212;
    border: 1px solid #222222;
    border-radius: 12px;
    padding: 12px 14px;
    transition: border-color 0.2s ease;
}

.cc-category-card:hover {
    border-color: #333333;
}

.cc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 10px;
}

.cc-category-title-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.cc-category-title-text {
    display: inline;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
}

.cc-category-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    display: inline;
}

/* Info Icon Button (ⓘ) - Inline with category title */
.cc-btn-info {
    background: transparent;
    border: none;
    color: #71717a;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-left: 5px;
    transition: color 0.2s ease, background 0.2s ease;
}

.cc-btn-info:hover {
    color: #ffffff;
    background: #27272a;
}

.cc-category-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cc-status-text {
    font-size: 12px;
    color: #a1a1aa;
    font-weight: 500;
}

.cc-status-text.cc-status-required {
    color: #ffffff;
    font-weight: 600;
}

.cc-category-desc {
    font-size: 12px;
    color: #888888;
    line-height: 1.4;
    margin: 0;
}

/* Custom iOS Switch */
.cc-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

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

.cc-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3f3f46;
    transition: 0.25s;
    border-radius: 22px;
}

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

.cc-switch input:checked + .cc-slider {
    background-color: #ffffff;
}

.cc-switch input:checked + .cc-slider:before {
    transform: translateX(18px);
    background-color: #000000;
}

.cc-switch input:disabled + .cc-slider {
    background-color: #ffffff;
    opacity: 0.9;
    cursor: not-allowed;
}

.cc-switch input:disabled + .cc-slider:before {
    background-color: #000000;
}

/* --- View 3: Sub-cookies Detail View Styling --- */
.cc-subcookies-heading {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cc-subcookie-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.cc-subcookie-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.cc-subcookie-card:hover {
    border-color: #374151;
    background: #131d31;
}

.cc-subcookie-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.cc-subcookie-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.cc-subcookie-icon-wrapper.icon-purple {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.cc-subcookie-icon-wrapper.icon-green {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.cc-subcookie-icon-wrapper.icon-orange {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
}

.cc-subcookie-icon-wrapper.icon-rose {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
}

.cc-subcookie-icon-wrapper.icon-teal {
    background: rgba(20, 184, 166, 0.15);
    color: #2dd4bf;
}

.cc-subcookie-icon-wrapper.icon-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.cc-subcookie-icon-wrapper.icon-indigo {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.cc-subcookie-icon-wrapper.icon-amber {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.cc-subcookie-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

.cc-subcookie-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cc-subcookie-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    word-break: break-word;
}

.cc-subcookie-desc {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.45;
    margin: 0;
}

.cc-subcookie-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    text-align: right;
    min-width: 75px;
}

.cc-subcookie-expiry-label {
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 3px;
}

.cc-subcookie-expiry-value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 600;
}

.cc-subcookie-expiry-value.expiry-session {
    color: #c084fc;
}

.cc-subcookie-expiry-value.expiry-persistent {
    color: #4ade80;
}

.cc-info-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11.5px;
    color: #94a3b8;
    line-height: 1.45;
    margin-top: 6px;
}


/* Responsive Rules */
@media (max-width: 480px) {
    .cc-banner-floating-wrapper {
        bottom: 12px;
        right: 50%;
        transform: translateX(50%) translateY(120%);
        width: calc(100vw - 24px);
    }
    .cc-banner-floating-wrapper.cc-show {
        transform: translateX(50%) translateY(0) !important;
    }
    .cc-banner-row-buttons {
        flex-direction: column;
    }
    .cc-banner-row-buttons .cc-btn {
        width: 100%;
    }
}
