/* Legal Documents Modal Styles */
/* Note: Shop theme colors will be applied via get-shop-styles.php at the end of this file */

.legal-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.legal-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.legal-modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
    margin: auto;
    /* Removed font smoothing for crisp text */
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    text-rendering: optimizeSpeed;
}

.legal-modal.show .legal-modal-content {
    transform: scale(1);
}

.legal-modal-header {
    padding: 30px 40px;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
    color: white;
}

.legal-modal-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 15px;
}

.legal-modal-header i {
    font-size: 32px;
}

.legal-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.legal-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.legal-modal-body {
    padding: 40px;
    overflow-y: auto;
    flex: 1;
    color: #000000 !important; /* Black text for maximum readability */
    line-height: 1.8;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    /* Crisp text rendering for better readability */
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    text-rendering: optimizeSpeed;
}

.legal-modal-body h2 {
    color: #000000 !important; /* Black headers for maximum readability */
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 700;
    /* Crisp header text */
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    letter-spacing: 0;
}

.legal-modal-body h3 {
    color: #000000 !important; /* Black subheaders for maximum readability */
    font-size: 20px;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
    /* Crisp header text */
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    letter-spacing: 0;
}

.legal-modal-body p {
    margin-bottom: 15px;
    color: #000000 !important; /* Black paragraphs for maximum readability */
    font-size: 16px;
    font-weight: 400;
    /* Crisp paragraph text */
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
}

.legal-modal-body strong {
    color: #000000 !important; /* Black bold text for maximum readability */
    font-weight: 600;
}

.legal-modal-body ul {
    margin: 15px 0;
    padding-left: 25px;
}

.legal-modal-body ul li {
    margin-bottom: 10px;
    color: #000000 !important; /* Black list items for maximum readability */
    font-size: 16px;
    font-weight: 400;
    /* Crisp list text */
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
}

.legal-modal-body a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.legal-modal-body a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.legal-modal-footer {
    padding: 20px 40px;
    border-top: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
    border-radius: 0 0 16px 16px;
}

.legal-last-updated {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legal-last-updated i {
    color: #9ca3af;
}

.legal-modal-close-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legal-modal-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Terms of Service specific styling */
/* Removed custom gradients - now uses shop theme colors from get-shop-styles.php */
/* .legal-modal.terms-modal .legal-modal-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.legal-modal.terms-modal .legal-modal-close-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.legal-modal.terms-modal .legal-modal-close-btn:hover {
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.4);
} */

/* Dark Mode Support */
[data-theme="dark"] .legal-modal {
    background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .legal-modal-content {
    background: #1f2937;
}

[data-theme="dark"] .legal-modal-header {
    border-bottom-color: #374151;
}

[data-theme="dark"] .legal-modal-body {
    color: #e5e7eb;
}

[data-theme="dark"] .legal-modal-body h2 {
    color: #f9fafb;
}

[data-theme="dark"] .legal-modal-body h3 {
    color: #e5e7eb;
}

[data-theme="dark"] .legal-modal-body p,
[data-theme="dark"] .legal-modal-body ul li {
    color: #d1d5db;
}

[data-theme="dark"] .legal-modal-body strong {
    color: #f9fafb;
}

[data-theme="dark"] .legal-modal-footer {
    background: #111827;
    border-top-color: #374151;
}

[data-theme="dark"] .legal-last-updated {
    color: #9ca3af;
}

/* Scrollbar Styling */
.legal-modal-body::-webkit-scrollbar {
    width: 8px;
}

.legal-modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.legal-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.legal-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

[data-theme="dark"] .legal-modal-body::-webkit-scrollbar-track {
    background: #374151;
}

[data-theme="dark"] .legal-modal-body::-webkit-scrollbar-thumb {
    background: #4b5563;
}

[data-theme="dark"] .legal-modal-body::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .legal-modal {
        padding: 10px;
    }

    .legal-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }

    .legal-modal-header {
        padding: 20px 25px;
        border-radius: 12px 12px 0 0;
    }

    .legal-modal-header h2 {
        font-size: 22px;
    }

    .legal-modal-header i {
        font-size: 26px;
    }

    .legal-modal-close {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .legal-modal-body {
        padding: 25px 20px;
    }

    .legal-modal-body h2 {
        font-size: 20px;
    }

    .legal-modal-body h3 {
        font-size: 18px;
    }

    .legal-modal-body p,
    .legal-modal-body ul li {
        font-size: 14px;
    }

    .legal-modal-footer {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        border-radius: 0 0 12px 12px;
    }

    .legal-last-updated {
        justify-content: center;
    }

    .legal-modal-close-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Enhanced Cool Animations for Modal Entrance */

/* Backdrop fade with blur effect */
@keyframes modalBackdropFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

/* Modal content entrance with bounce and scale */
@keyframes modalSlideInBounce {
    0% {
        transform: scale(0.7) translateY(-50px) rotateX(10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) translateY(10px) rotateX(-2deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) translateY(0) rotateX(0deg);
        opacity: 1;
    }
}

/* Header slide in from top */
@keyframes headerSlideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Content fade in with stagger effect */
@keyframes contentFadeInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Close button pulse effect */
@keyframes closeBtnPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* Modal exit animation */
@keyframes modalSlideOut {
    from {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    to {
        transform: scale(0.8) translateY(-30px);
        opacity: 0;
    }
}

/* Apply animations to modal elements */
.legal-modal.show {
    animation: modalBackdropFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.legal-modal.show .legal-modal-content {
    animation: modalSlideInBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.legal-modal.show .legal-modal-header {
    animation: headerSlideIn 0.5s ease-out 0.2s both;
}

.legal-modal.show .legal-modal-body {
    animation: contentFadeInUp 0.5s ease-out 0.3s both;
}

.legal-modal.show .legal-modal-footer {
    animation: contentFadeInUp 0.5s ease-out 0.4s both;
}

.legal-modal.show .legal-modal-close {
    animation: closeBtnPulse 2s infinite 1s;
}

/* Exit animation class */
.legal-modal.hide .legal-modal-content {
    animation: modalSlideOut 0.3s ease-in forwards;
}

/* SHOP THEME COLORS - HIGH SPECIFICITY OVERRIDES */
/* These styles will be overridden by get-shop-styles.php with actual admin colors */

/* Override Terms modal header with shop theme - Ultra high specificity */
html body .legal-modal.terms-modal .legal-modal-header,
body .legal-modal.terms-modal .legal-modal-header,
.legal-modal.terms-modal .legal-modal-header {
    background: var(--shop-icon-color, #10b981) !important;
}

/* Override Terms modal close button with shop theme - Ultra high specificity */
html body .legal-modal.terms-modal .legal-modal-close-btn,
body .legal-modal.terms-modal .legal-modal-close-btn,
.legal-modal.terms-modal .legal-modal-close-btn {
    background: var(--shop-icon-color, #10b981) !important;
}

/* Override all legal modal content with shop card background */
html body .legal-modal-content,
body .legal-modal-content,
.legal-modal-content {
    background: var(--shop-card-bg, #ffffff) !important;
}

/* Override all legal modal headers with shop icon color */
html body .legal-modal-header,
body .legal-modal-header,
.legal-modal-header {
    background: var(--shop-icon-color, #10b981) !important;
}

/* Override all legal modal close buttons with shop icon color */
html body .legal-modal-close-btn,
body .legal-modal-close-btn,
.legal-modal-close-btn {
    background: var(--shop-icon-color, #10b981) !important;
}

/* Override all legal modal footers with shop card background */
html body .legal-modal-footer,
body .legal-modal-footer,
.legal-modal-footer {
    background: var(--shop-card-bg, #f9fafb) !important;
}
