/* ==========================================================================
   PM Cookie Consent - Banner Styles
   ========================================================================== */

/* Reset & Base */
.pmcc-banner,
.pmcc-banner * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Overlay */
.pmcc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
}

/* Banner Container */
.pmcc-banner {
    position: fixed;
    z-index: 999999;
    background: var(--pmcc-bg, #ffffff);
    color: var(--pmcc-text, #494949);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

/* Positions */
.pmcc-position-bottom {
    bottom: 0;
    left: 0;
    right: 0;
}

.pmcc-position-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 680px;
    width: calc(100% - 32px);
    border-radius: 16px;
}

/* Styles */
.pmcc-style-bar {
    border-radius: 0;
}

.pmcc-style-box.pmcc-position-bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 680px;
    width: calc(100% - 32px);
    border-radius: 16px;
}

/* Banner Content */
.pmcc-banner-content {
    padding: 24px 32px;
    display: flex;
    gap: 24px;
    align-items: center;
}

.pmcc-position-center .pmcc-banner-content,
.pmcc-style-box .pmcc-banner-content {
    flex-direction: column;
    align-items: stretch;
}

.pmcc-banner-text {
    flex: 1;
}

.pmcc-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--pmcc-text);
    line-height: 1.3;
}

.pmcc-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--pmcc-text);
    opacity: 0.85;
}

.pmcc-links {
    margin-top: 8px;
    font-size: 13px;
}

.pmcc-links a {
    color: var(--pmcc-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pmcc-links a:hover {
    opacity: 0.8;
}

.pmcc-link-sep {
    margin: 0 6px;
    opacity: 0.4;
}

/* Buttons */
.pmcc-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.pmcc-position-center .pmcc-banner-actions,
.pmcc-style-box .pmcc-banner-actions {
    justify-content: stretch;
}

.pmcc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.pmcc-btn:focus-visible {
    outline: 2px solid var(--pmcc-primary);
    outline-offset: 2px;
}

.pmcc-btn-accept-all {
    background: var(--pmcc-primary);
    color: #ffffff;
    flex: 1;
}

.pmcc-btn-accept-all:hover {
    background: var(--pmcc-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pmcc-btn-reject {
    background: transparent;
    color: var(--pmcc-text);
    border: 1.5px solid rgba(0, 0, 0, 0.15);
}

.pmcc-btn-reject:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.25);
}

.pmcc-btn-settings {
    background: transparent;
    color: var(--pmcc-primary);
    border: 1.5px solid var(--pmcc-primary);
}

.pmcc-btn-settings:hover {
    background: var(--pmcc-primary);
    color: #ffffff;
}

.pmcc-btn-save {
    background: var(--pmcc-primary);
    color: #ffffff;
    flex: 1;
}

.pmcc-btn-save:hover {
    background: var(--pmcc-primary-hover);
}

/* Views */
.pmcc-view {
    display: none;
}

.pmcc-view-active {
    display: block;
}

/* Settings View */
.pmcc-settings-content {
    padding: 24px 32px;
    max-height: 80vh;
    overflow-y: auto;
}

.pmcc-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pmcc-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--pmcc-text);
    opacity: 0.5;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.2s;
}

.pmcc-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

.pmcc-settings-intro {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.8;
    margin-bottom: 20px;
}

/* Category Sections */
.pmcc-categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.pmcc-category {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 16px;
    transition: border-color 0.2s;
}

.pmcc-category:hover {
    border-color: rgba(0, 0, 0, 0.15);
}

.pmcc-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pmcc-category-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pmcc-category-label {
    font-size: 15px;
    font-weight: 600;
}

.pmcc-cookie-count {
    font-size: 12px;
    opacity: 0.5;
}

.pmcc-badge-required {
    font-size: 11px;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
    padding: 2px 8px;
    border-radius: 100px;
}

.pmcc-category-desc {
    font-size: 13px;
    opacity: 0.7;
    margin-top: 6px;
    line-height: 1.5;
}

.pmcc-category-expand {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: var(--pmcc-text);
    opacity: 0.4;
    transition: all 0.2s;
}

.pmcc-category-expand:hover {
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.04);
}

.pmcc-chevron {
    transition: transform 0.3s ease;
}

.pmcc-category-expanded .pmcc-chevron {
    transform: rotate(180deg);
}

/* Toggle Switch */
.pmcc-category-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.pmcc-toggle-switch {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d1d5db;
    border-radius: 24px;
    transition: background 0.3s;
}

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

.pmcc-category-toggle input:checked + .pmcc-toggle-switch {
    background: var(--pmcc-primary);
}

.pmcc-category-toggle input:checked + .pmcc-toggle-switch::before {
    transform: translateX(20px);
}

.pmcc-category-toggle input:disabled + .pmcc-toggle-switch {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Cookie Table */
.pmcc-category-details {
    margin-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 12px;
}

.pmcc-cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.pmcc-cookie-table th {
    text-align: left;
    font-weight: 600;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    white-space: nowrap;
}

.pmcc-cookie-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    vertical-align: top;
}

.pmcc-cookie-table code {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.05);
    padding: 1px 5px;
    border-radius: 3px;
    word-break: break-all;
}

/* Settings Footer Actions */
.pmcc-settings-actions {
    display: flex;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Animation */
.pmcc-banner.pmcc-animate-in {
    animation: pmccSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pmcc-banner.pmcc-animate-out {
    animation: pmccSlideOut 0.3s ease forwards;
}

@keyframes pmccSlideIn {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pmccSlideOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

.pmcc-position-center.pmcc-animate-in {
    animation: pmccFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pmcc-position-center.pmcc-animate-out {
    animation: pmccFadeOut 0.3s ease forwards;
}

@keyframes pmccFadeIn {
    from { transform: translate(-50%, -48%); opacity: 0; }
    to { transform: translate(-50%, -50%); opacity: 1; }
}

@keyframes pmccFadeOut {
    from { transform: translate(-50%, -50%); opacity: 1; }
    to { transform: translate(-50%, -48%); opacity: 0; }
}

.pmcc-style-box.pmcc-position-bottom.pmcc-animate-in {
    animation: pmccBoxIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pmccBoxIn {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .pmcc-banner-content {
        flex-direction: column;
        padding: 20px;
        gap: 16px;
    }

    .pmcc-banner-actions {
        flex-direction: column;
        width: 100%;
    }

    .pmcc-btn {
        width: 100%;
        padding: 14px 20px;
    }

    .pmcc-settings-content {
        padding: 20px;
    }

    .pmcc-settings-actions {
        flex-direction: column;
    }

    .pmcc-cookie-table {
        display: block;
        overflow-x: auto;
    }

    .pmcc-style-box.pmcc-position-bottom {
        bottom: 0;
        left: 0;
        transform: none;
        width: 100%;
        border-radius: 16px 16px 0 0;
    }
}

/* Re-open settings button */
.pmcc-open-settings {
    cursor: pointer;
    color: var(--pmcc-primary, #494949);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Floating re-open icon */
#pmcc-reopen {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--pmcc-primary, #494949);
    color: white;
    border: none;
    cursor: pointer;
    z-index: 999997;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

#pmcc-reopen:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

#pmcc-reopen svg {
    width: 22px;
    height: 22px;
}
