/**
 * Local Consent Gate - Frontend Styles
 * Version: 1.3.0
 */

/* ==========================================================================
   Base Styles (shared by all presets)
   ========================================================================== */

.lcg-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 1.25rem 1rem;
    z-index: 99999;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #212529;
}

.lcg-banner__content {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.lcg-banner__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1 1 100%;
}

.lcg-banner__text {
    margin: 0;
    flex: 1 1 auto;
    min-width: 200px;
    color: #495057;
}

.lcg-banner__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ==========================================================================
   Buttons (shared)
   ========================================================================== */

.lcg-btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: 1px solid #6c757d;
    background: #ffffff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.lcg-btn:hover {
    opacity: 0.9;
}

.lcg-btn:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.lcg-btn--accept-all {
    background: #0d6efd;
    color: #ffffff;
    border-color: #0d6efd;
}

.lcg-btn--accept-all:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
}

.lcg-btn--reject {
    background: #6c757d;
    color: #ffffff;
    border-color: #6c757d;
}

.lcg-btn--reject:hover {
    background: #5c636a;
    border-color: #565e64;
}

.lcg-btn--customize {
    background: #ffffff;
    color: #212529;
    border-color: #ced4da;
}

.lcg-btn--customize:hover {
    background: #e9ecef;
}

.lcg-btn--save {
    background: #0d6efd;
    color: #ffffff;
    border-color: #0d6efd;
}

.lcg-btn--save:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
}

.lcg-btn--withdraw {
    background: #dc3545;
    color: #ffffff;
    border-color: #dc3545;
}

.lcg-btn--withdraw:hover {
    background: #bb2d3b;
    border-color: #b02a37;
}

/* ==========================================================================
   Preferences Modal
   ========================================================================== */

.lcg-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #212529;
}

.lcg-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.lcg-modal__content {
    background: #ffffff;
    border-radius: 8px;
    max-width: 520px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 1;
    padding: 1.75rem;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.lcg-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.lcg-modal__header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.lcg-modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    color: #6c757d;
    transition: color 0.15s ease;
}

.lcg-modal__close:hover {
    color: #212529;
}

.lcg-modal__body {
    margin-bottom: 1.25rem;
}

.lcg-modal__body p {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #495057;
}

.lcg-modal__footer {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid #dee2e6;
}

/* ==========================================================================
   Toggle Switches
   ========================================================================== */

.lcg-toggle-group {
    margin: 1rem 0;
}

.lcg-toggle {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.lcg-toggle:last-child {
    margin-bottom: 0;
}

.lcg-toggle input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    margin-right: 0.75rem;
    margin-top: 0.15rem;
    cursor: pointer;
    flex-shrink: 0;
}

.lcg-toggle input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.lcg-toggle label {
    cursor: pointer;
    flex: 1;
    font-weight: 500;
}

.lcg-toggle input[type="checkbox"]:disabled + label {
    cursor: not-allowed;
}

.lcg-always-on {
    font-weight: 400;
    font-size: 0.85em;
    color: #6c757d;
    font-style: italic;
}

.lcg-category-desc {
    margin: 2px 0 0 0;
    font-size: 0.8em;
    color: #6c757d;
    font-weight: 400;
}

.lcg-sensitive-note {
    font-size: 0.85em;
    color: #6c757d;
    font-style: italic;
    margin-left: 0.25rem;
}

/* ==========================================================================
   Persistent Settings Button
   ========================================================================== */

.lcg-settings-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99998;
    background: #0d6efd;
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.lcg-settings-btn:hover {
    background: #0b5ed7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lcg-settings-btn:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.lcg-settings-btn--shortcode {
    position: static;
    box-shadow: none;
}

/* ==========================================================================
   Banner Style Presets
   ========================================================================== */

/* Clean Light (default) */
.lcg-style-clean-light {
    /* already the base style */
}

/* Dark Luxury */
.lcg-style-dark-luxury {
    background: #1a1a1a;
    border-top-color: #333;
    color: #f0f0f0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}
.lcg-style-dark-luxury .lcg-banner__title {
    color: #d4af37;
}
.lcg-style-dark-luxury .lcg-banner__text {
    color: #cccccc;
}
.lcg-style-dark-luxury .lcg-btn {
    background: #2a2a2a;
    border-color: #555;
    color: #f0f0f0;
}
.lcg-style-dark-luxury .lcg-btn:hover {
    background: #3a3a3a;
}
.lcg-style-dark-luxury .lcg-btn--accept-all {
    background: #d4af37;
    border-color: #d4af37;
    color: #1a1a1a;
}
.lcg-style-dark-luxury .lcg-btn--accept-all:hover {
    background: #c5a028;
}
.lcg-style-dark-luxury .lcg-btn--reject {
    background: #444;
    border-color: #666;
    color: #ddd;
}
.lcg-style-dark-luxury .lcg-btn--customize {
    background: transparent;
    border-color: #555;
    color: #ccc;
}
.lcg-style-dark-luxury .lcg-btn--customize:hover {
    background: #2a2a2a;
}

/* Compact */
.lcg-style-compact {
    padding: 0.6rem 1rem;
    font-size: 13px;
}
.lcg-style-compact .lcg-banner__title {
    font-size: 1rem;
    flex: 0 0 auto;
    margin-right: 1rem;
}
.lcg-style-compact .lcg-banner__text {
    font-size: 12px;
}
.lcg-style-compact .lcg-btn {
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
}

/* Center Modal */
.lcg-style-center-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    bottom: auto;
    right: auto;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    background: #fff;
}
.lcg-style-center-modal::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}
.lcg-style-center-modal .lcg-banner__content {
    display: block;
}
.lcg-style-center-modal .lcg-banner__title {
    text-align: center;
    margin-bottom: 0.5rem;
}
.lcg-style-center-modal .lcg-banner__text {
    text-align: center;
    margin-bottom: 1rem;
}
.lcg-style-center-modal .lcg-banner__actions {
    justify-content: center;
}

/* ==========================================================================
   Equal Button Weight (when option enabled)
   ========================================================================== */

.lcg-equal-buttons .lcg-btn--accept-all,
.lcg-equal-buttons .lcg-btn--reject {
    flex: 1;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.lcg-equal-buttons .lcg-btn--reject {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.lcg-equal-buttons .lcg-btn--reject:hover {
    background: #bb2d3b;
    border-color: #b02a37;
}

.lcg-equal-buttons .lcg-btn--customize {
    flex: 0 0 auto;
    background: transparent;
    border-color: #ced4da;
    color: #495057;
    opacity: 0.8;
}

.lcg-equal-buttons .lcg-btn--customize:hover {
    opacity: 1;
    background: #e9ecef;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 600px) {
    .lcg-banner__content {
        flex-direction: column;
        align-items: flex-start;
    }

    .lcg-banner__actions {
        width: 100%;
        flex-direction: column;
    }

    .lcg-banner__actions .lcg-btn {
        width: 100%;
    }

    .lcg-modal__content {
        width: 95%;
        padding: 1.25rem;
        max-height: 90vh;
    }

    .lcg-modal__footer {
        flex-direction: column;
    }

    .lcg-modal__footer .lcg-btn {
        width: 100%;
    }

    .lcg-settings-btn {
        bottom: 10px;
        left: 10px;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .lcg-style-center-modal {
        width: 95%;
        padding: 1.5rem;
    }

    .lcg-equal-buttons .lcg-btn--accept-all,
    .lcg-equal-buttons .lcg-btn--reject {
        flex: none;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lcg-btn,
    .lcg-modal__close,
    .lcg-settings-btn {
        transition: none;
    }
}

/* ==========================================================================
   Embed Placeholder
   ========================================================================== */
.lcg-embed-placeholder {
    background: #f8f9fa;
    border: 2px dashed #ced4da;
    padding: 2rem;
    text-align: center;
    margin: 1rem 0;
    border-radius: 6px;
    color: #495057;
}
.lcg-embed-placeholder p {
    margin-bottom: 0.75rem;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .lcg-banner,
    .lcg-modal,
    .lcg-settings-btn {
        display: none !important;
    }
}
/* GPC notice (injected client-side into banner and modal) */
.lcg-gpc-notice {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #eef6ff;
    border: 1px solid #c5d9ed;
    color: #0a4b78;
    font-size: 0.9em;
    line-height: 1.5;
}

/* Cookie disclosure page (shortcode output) */
.lcg-cookies-cat { margin: 0 0 1.5rem; padding: 1rem; background: #f8f9fa; border-left: 4px solid #2271b1; }
.lcg-cookies-cat--always { border-left-color: #00824a; }
.lcg-cookies-cat h3 { margin: 0 0 .35rem; }
.lcg-cookies-table { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.lcg-cookies-table th, .lcg-cookies-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid #e2e4e7; font-size: .92em; }
.lcg-cookies-disclaimer { font-size: .88em; color: #50575e; }
