/**
 * GDPR Frontend Banner Styles - Ordertune Design
 */

/* Ordertune Color Variables */
:root {
    --ordertune-black: #1a1a1a;
    --ordertune-dark: #2a2a2a;
    --ordertune-neon: #c5ff00;
    --ordertune-neon-hover: #d4ff33;
    --ordertune-text: #e0e0e0;
    --ordertune-text-dark: #999999;
}

/* Banner Container */
.gdpr-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 999999;
    background: var(--banner-bg, var(--ordertune-black));
    color: var(--banner-text, var(--ordertune-text));
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.gdpr-banner-bottom {
    bottom: 0;
}

.gdpr-banner-top {
    top: 0;
}

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

/* Animation variants */
.gdpr-animation-fade {
    transition: opacity 0.3s ease;
}

.gdpr-animation-slide.gdpr-banner-bottom {
    transform: translateY(100%);
}

.gdpr-animation-slide.gdpr-banner-top {
    transform: translateY(-100%);
}

.gdpr-animation-slide.gdpr-banner-visible {
    transform: translateY(0);
}

/* Banner Content - Compact Single Line */
.gdpr-banner-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 20px;
}

.gdpr-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.gdpr-banner-message {
    flex: 1 1 auto;
    line-height: 1.4;
    font-size: 13px;
    color: var(--ordertune-text);
}

.gdpr-privacy-link {
    color: var(--ordertune-neon);
    text-decoration: underline;
    margin-left: 5px;
    transition: color 0.2s ease;
}

.gdpr-privacy-link:hover {
    color: var(--ordertune-neon-hover);
    text-decoration: none;
}

/* Banner Actions - Inline */
.gdpr-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Buttons - Compact Ordertune Style */
.gdpr-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.gdpr-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gdpr-btn:active {
    transform: translateY(0);
}

.gdpr-btn:focus {
    outline: 2px solid var(--ordertune-neon);
    outline-offset: 2px;
}

.gdpr-btn-accept {
    background: var(--accept-bg, var(--ordertune-neon));
    color: var(--accept-text, var(--ordertune-black));
    font-weight: 700;
}

.gdpr-btn-accept:hover {
    background: var(--ordertune-neon-hover);
}

.gdpr-btn-reject {
    background: transparent;
    color: var(--reject-text, var(--ordertune-text));
    border: 1px solid var(--ordertune-text-dark);
}

.gdpr-btn-reject:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--ordertune-text);
}

.gdpr-btn-manage {
    background: transparent;
    color: var(--manage-text, var(--ordertune-text));
    border: 1px solid var(--ordertune-text-dark);
}

.gdpr-btn-manage:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--ordertune-text);
}

.gdpr-btn-primary {
    background: var(--ordertune-neon);
    color: var(--ordertune-black);
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px;
}

.gdpr-btn-primary:hover {
    background: var(--ordertune-neon-hover);
}

/* Modal - Ordertune Design with Fixed Scrolling */
.gdpr-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gdpr-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    animation: gdprFadeIn 0.3s ease;
}

.gdpr-modal-content {
    position: relative;
    background: var(--ordertune-dark);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: gdprSlideUp 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes gdprFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes gdprSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.gdpr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.gdpr-modal-header h2 {
    margin: 0;
    font-size: 22px;
    color: var(--ordertune-text);
    font-weight: 700;
}

.gdpr-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ordertune-text-dark);
    transition: all 0.2s ease;
    border-radius: 6px;
}

.gdpr-modal-close:hover {
    color: var(--ordertune-text);
    background: rgba(255, 255, 255, 0.05);
}

.gdpr-modal-close:focus {
    outline: 2px solid var(--ordertune-neon);
    outline-offset: 2px;
}

/* Modal Body - Fixed Scrolling with Always Visible Scrollbar */
.gdpr-modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;

    /* Force scrollbar to always be visible and functional */
    scrollbar-width: thin;
    scrollbar-color: var(--ordertune-neon) rgba(255, 255, 255, 0.1);
}

/* Custom scrollbar for webkit browsers */
.gdpr-modal-body::-webkit-scrollbar {
    width: 10px;
}

.gdpr-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.gdpr-modal-body::-webkit-scrollbar-thumb {
    background: var(--ordertune-neon);
    border-radius: 5px;
    transition: background 0.2s ease;
}

.gdpr-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--ordertune-neon-hover);
}

.gdpr-modal-body > p {
    margin: 0 0 20px 0;
    color: var(--ordertune-text-dark);
    line-height: 1.6;
    font-size: 14px;
}

/* Categories - Compact to show all 5 without scrolling */
.gdpr-categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gdpr-category {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
}

.gdpr-category:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(197, 255, 0, 0.3);
}

.gdpr-category-header {
    margin-bottom: 6px;
}

.gdpr-switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.gdpr-category-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Toggle Switch - Ordertune Style */
.gdpr-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 13px;
    transition: background 0.3s ease;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gdpr-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--ordertune-text-dark);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.gdpr-category-toggle:checked + .gdpr-switch {
    background: var(--ordertune-neon);
    border-color: var(--ordertune-neon);
}

.gdpr-category-toggle:checked + .gdpr-switch::after {
    transform: translateX(24px);
    background: var(--ordertune-black);
}

.gdpr-category-toggle:disabled + .gdpr-switch {
    opacity: 0.5;
    cursor: not-allowed;
}

.gdpr-category-toggle:focus + .gdpr-switch {
    outline: 2px solid var(--ordertune-neon);
    outline-offset: 2px;
}

.gdpr-category-label {
    flex: 1;
    font-weight: 600;
    color: var(--ordertune-text);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.gdpr-required-badge {
    display: inline-block;
    padding: 3px 8px;
    background: var(--ordertune-neon);
    color: var(--ordertune-black);
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gdpr-category-description {
    color: var(--ordertune-text-dark);
    font-size: 12px;
    line-height: 1.4;
    margin-top: 4px;
    padding-left: 62px;
}

/* Modal Footer */
.gdpr-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* Responsive - Mobile Optimization */
@media (max-width: 768px) {
    .gdpr-banner-container {
        padding: 12px 16px;
    }

    .gdpr-banner-content {
        flex-direction: column;
        gap: 12px;
    }

    .gdpr-banner-message {
        font-size: 12px;
    }

    .gdpr-banner-actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
    }

    /* Hide Reject button on mobile - only Accept + Manage */
    .gdpr-btn-reject {
        display: none;
    }

    /* Accept button on the right for right-handed users */
    .gdpr-btn-accept {
        order: 2;
        flex: 1.2;
        font-size: 13px;
        padding: 10px 16px;
        font-weight: 700;
    }

    .gdpr-btn-manage {
        order: 1;
        flex: 1;
        font-size: 12px;
        padding: 10px 12px;
    }

    .gdpr-modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }

    .gdpr-modal-header {
        padding: 16px;
    }

    .gdpr-modal-header h2 {
        font-size: 20px;
    }

    .gdpr-modal-body {
        padding: 16px;
    }

    .gdpr-modal-footer {
        padding: 16px;
    }

    .gdpr-category {
        padding: 12px;
    }

    .gdpr-category-description {
        padding-left: 0;
        margin-top: 8px;
    }

    /* Larger Save Preferences button on mobile */
    .gdpr-btn-primary {
        width: 100%;
        padding: 16px 32px;
        font-size: 16px;
        font-weight: 700;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .gdpr-banner-message {
        font-size: 11px;
    }

    .gdpr-btn {
        font-size: 11px;
        padding: 6px 10px;
    }

    .gdpr-modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* Print: hide banner */
@media print {
    .gdpr-banner,
    .gdpr-modal {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gdpr-banner {
        border: 2px solid var(--ordertune-neon);
    }

    .gdpr-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .gdpr-banner,
    .gdpr-modal-content,
    .gdpr-btn,
    .gdpr-switch,
    .gdpr-switch::after {
        transition: none !important;
        animation: none !important;
    }
}
