/**
 * BV Consent Banner & Modal Styles
 * Franchise Platform Consent Module
 */

/* ===========================
   BANNER STYLES
   =========================== */

/* Banner container - fixed at bottom */
.bv-consent-banner {
  display: none;
  position: fixed;
  bottom: 12px;
  left: 0;
  right: 0;
  color: #000;
  z-index: 999999;
  width: 90%;
  background: #fff;
  border: none;
  border-radius: 10px;
  padding: 22px 30px;
  max-width: 920px;
  margin: 0 auto 35px;
  box-shadow: 0px 16px 100px 0px rgba(0, 0, 0, 0.15);
}

/* Banner message */
.bv-consent-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #000;
    text-align: left;
    font-weight: 500;
}

/* Banner links */
.bv-consent-link {
    color: #000;
    text-decoration: underline;
    margin: 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.bv-consent-link:hover {
    color: #a8d1ff;
}

.bv-consent-container {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-direction: row;
}

.bv-consent-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ===========================
   MODAL STYLES
   =========================== */

/* Modal overlay */
.bv-consent-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999999;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0;
}

/* Overlay background */
.bv-consent-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

/* Modal content container */
.bv-consent-modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  max-width: 400px;
  width: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  height: 100%;
  border-radius: 0;
}

/* Modal header */
.bv-consent-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.bv-consent-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3338;
}

.bv-consent-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.bv-consent-modal-close:hover {
    background: #f0f0f0;
}

/* Modal body */
.bv-consent-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.bv-consent-modal-intro {
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

/* Toggle items */
.bv-consent-toggle-item {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 12px;
}

.bv-consent-toggle-item:last-child {
    margin-bottom: 0;
}

.bv-consent-toggle-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.bv-consent-toggle-info {
    flex: 1;
}

.bv-consent-toggle-title {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 600;
    color: #2c3338;
}

.bv-consent-toggle-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #666;
}

/* Toggle switch */
.bv-consent-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    margin: 0;
}

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

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

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

.bv-consent-switch input:checked + .bv-consent-slider {
    background-color: #000;
}

.bv-consent-switch input:checked + .bv-consent-slider:before {
    transform: translateX(24px);
}

.bv-consent-switch input:focus + .bv-consent-slider {
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Modal footer */
.bv-consent-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.bv-consent-modal-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.bv-consent-modal-link:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Buttons */
.bv-consent-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: inherit;
}

.bv-consent-btn-save {
    background: #000;
    color: #fff;
}

.bv-consent-btn-save:hover {
    background: #222;
}

.bv-consent-btn-save:focus {
    outline: 2px solid #222;
    outline-offset: 2px;
}

.bv-consent-btn-accept {
    background: #000;
    color: #fff;
    border: 1px solid #000;
}

.bv-consent-btn-accept:hover {
    background: #222;
    border-color: #222;
}

.bv-consent-btn-close {
  background: #f5f5f5;
  color: #000;
  border: 1px solid #ddd;
  border-radius: 50%;
  height: 24px;
  width: 24px;
  padding: 0;
  position: absolute;
  right: -10px;
  top: -10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bv-consent-btn-close:hover {
    background: #ebebeb;
}

/* ===========================
   MOBILE RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    
    .bv-consent-banner {
        padding: 14px 16px;
        bottom: 24px;
    }

    .bv-consent-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .bv-consent-message {
        font-size: 13px;
    }

    .bv-consent-modal {
        padding: 16px;
    }

    .bv-consent-modal-content {
        max-height: 95vh;
    }

    .bv-consent-modal-header {
        padding: 20px 20px 16px;
    }

    .bv-consent-modal-title {
        font-size: 18px;
    }

    .bv-consent-modal-body {
        padding: 20px;
    }

    .bv-consent-modal-footer {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px;
    }

    .bv-consent-toggle-header {
        flex-direction: column;
        gap: 12px;
    }

    .bv-consent-toggle-control {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .bv-consent-banner {
        padding: 12px 14px;
    }

    .bv-consent-message {
        font-size: 12px;
    }

    .bv-consent-modal-header {
        padding: 16px;
    }

    .bv-consent-modal-title {
        font-size: 16px;
    }

    .bv-consent-modal-body {
        padding: 16px;
    }

    .bv-consent-modal-footer {
        padding: 14px 16px;
    }

    .bv-consent-toggle-item {
        padding: 14px;
    }

    .bv-consent-toggle-title {
        font-size: 14px;
    }

    .bv-consent-toggle-desc {
        font-size: 12px;
    }
}

/* ===========================
   ACCESSIBILITY
   =========================== */

@media (prefers-reduced-motion: reduce) {
    .bv-consent-btn,
    .bv-consent-link,
    .bv-consent-slider,
    .bv-consent-slider:before {
        transition: none;
    }
}

@media (prefers-contrast: high) {
    .bv-consent-banner {
        border-top: 3px solid #fff;
    }

    .bv-consent-btn,
    .bv-consent-slider {
        border: 2px solid currentColor;
    }
}

/* Focus visible for keyboard navigation */
.bv-consent-link:focus-visible,
.bv-consent-btn:focus-visible,
.bv-consent-modal-close:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}
