/**
 * Cookie Consent Banner Styles
 * Bottom-left modal with tabs - CRDB Bank theme
 */

/* Banner Container - Bottom-left modal */
.cc-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: auto;
    width: 500px;
    max-width: calc(100vw - 40px);
    max-height: 85vh;
    z-index: 9999;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cc-banner.cc-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header with close button */
.cc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e8e8e8;
    background: #fafafa;
}

.cc-title {
    font-size: 16px;
    font-weight: 600;
    color: #242424;
    margin: 0;
    font-family: inherit;
}

.cc-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin: -8px -8px -8px 8px;
    color: #666;
    transition: color 0.2s;
    border-radius: 4px;
}

.cc-close-btn:hover {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

/* Tabs */
.cc-tabs {
    display: flex;
    border-bottom: 2px solid #e8e8e8;
    background: #fafafa;
}

.cc-tab {
    flex: 1;
    padding: 14px 16px;
    text-align: center;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
    position: relative;
}

.cc-tab:hover {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.05);
}

.cc-tab.active {
    color: #4caf50;
    font-weight: 600;
}

.cc-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #4caf50;
}

/* Tab Content */
.cc-tab-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: none;
}

.cc-tab-content.active {
    display: block;
}

/* Consent Tab Content */
.cc-consent-message {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.7);
    line-height: 1.6;
    margin-bottom: 20px;
}

.cc-links {
    margin-top: 12px;
}

.cc-link {
    color: #4caf50;
    text-decoration: none;
    transition: color 0.2s;
}

.cc-link:hover {
    color: #388e3c;
    text-decoration: underline;
}

/* Cookie Categories Table */
.cc-categories-table {
    width: 100%;
    margin: 20px 0 0;
    border-collapse: collapse;
}

.cc-categories-table th {
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #242424;
    padding: 8px 12px 8px 0;
    border-bottom: 2px solid #e8e8e8;
}

.cc-categories-table td {
    padding: 12px 12px 12px 0;
    vertical-align: middle;
}

/* Custom Checkbox (Toggle) */
.cc-checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.cc-checkbox {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cc-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

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

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

.cc-checkbox input:checked + .cc-toggle-slider {
    background-color: #4caf50;
}

.cc-checkbox input:checked + .cc-toggle-slider:before {
    transform: translateX(20px);
}

.cc-checkbox input:disabled + .cc-toggle-slider {
    background-color: #4caf5088;
    cursor: not-allowed;
    opacity: 0.7;
}

.cc-checkbox input:disabled + .cc-toggle-slider:before {
    transform: translateX(20px);
}

/* Details Tab Content */
.cc-detail-section {
    margin-bottom: 20px;
}

.cc-detail-title {
    font-size: 14px;
    font-weight: 600;
    color: #242424;
    margin: 0 0 8px 0;
}

.cc-detail-text {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.65);
    line-height: 1.6;
    margin: 0;
}

/* About Tab Content */
.cc-about-text {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.65);
    line-height: 1.7;
    margin: 0;
}

/* Buttons Section */
.cc-buttons {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e8e8e8;
    background: #fafafa;
    flex-wrap: wrap;
}

.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.cc-btn:focus {
    outline: 2px solid #4caf50;
    outline-offset: 2px;
}

.cc-btn-deny {
    background: #fff;
    color: #242424;
    border: 2px solid rgba(76, 175, 80, 0.2);
    opacity: 0.8;
    flex: 1;
}

.cc-btn-deny:hover {
    border-color: #4caf50;
    color: #4caf50;
}

.cc-btn-allow-selected {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border: 2px solid rgba(76, 175, 80, 0.2);
    opacity: 0.8;
    flex: 1.5;
}

.cc-btn-allow-selected:hover {
    background: rgba(76, 175, 80, 0.2);
    color: #388e3c;
    border-color: #4caf50;
}

.cc-btn-accept-all {
    background: #4caf50;
    color: #fff;
    flex: 1.5;
}

.cc-btn-accept-all:hover {
    background: #388e3c;
}

/* Responsive Design */
@media (max-width: 600px) {
    .cc-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        max-width: none;
        border-radius: 8px;
    }

    .cc-tabs {
        flex-wrap: wrap;
    }

    .cc-tab {
        flex: 1;
        min-width: 80px;
        padding: 12px 10px;
        font-size: 13px;
    }

    .cc-categories-table {
        font-size: 12px;
    }

    .cc-categories-table th,
    .cc-categories-table td {
        padding: 8px 8px 8px 0;
    }
/* 
    .cc-buttons {
        flex-direction: column;
    } */

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

@media (max-width: 400px) {
    .cc-categories-table {
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Animation */
@keyframes cc-check {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.cc-checkbox input:checked + .cc-toggle-slider {
    animation: cc-check 0.2s ease;
}

/* Print styles */
@media print {
    .cc-banner {
        display: none !important;
    }
}

/* Scrollbar styling */
.cc-tab-content::-webkit-scrollbar {
    width: 6px;
}

.cc-tab-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.cc-tab-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.cc-tab-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}
