/* Shared styles for LifeVisor pages */

/* Theme Variables */
:root {
    /* Dark theme (default) */
    --bg-primary: #0a0e27;
    --bg-secondary: rgba(26, 32, 53, 0.6);
    --bg-secondary-solid: #1a2035;
    --bg-modal: rgba(26, 32, 53, 0.98);
    --text-primary: #e0e0e0;
    --text-secondary: #a0aec0;
    --text-muted: #6b7280;
    --accent: #fbbf24;
    --accent-hover: #fcd34d;
    --accent-bg: rgba(251, 191, 36, 0.2);
    --accent-bg-hover: rgba(251, 191, 36, 0.3);
    --border-color: #2d3748;
    --link-color: #60a5fa;
    --link-hover: #93c5fd;
    --error-color: #f87171;
    --error-bg: rgba(248, 113, 113, 0.1);
    --error-border: rgba(248, 113, 113, 0.3);
    --overlay-bg: rgba(0, 0, 0, 0.8);
    --shadow-color: rgba(0, 0, 0, 0.6);
    /* Escape method colors */
    --escape-direct: #6ee7b7;
    --escape-meta: #c4b5fd;
    --escape-critical: #fdba74;
    --escape-humility: #93c5fd;
}

[data-theme="light"] {
    --bg-primary: #f8f9fa;
    --bg-secondary: rgba(255, 255, 255, 0.9);
    --bg-secondary-solid: #ffffff;
    --bg-modal: rgba(255, 255, 255, 0.98);
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --accent: #d97706;
    --accent-hover: #b45309;
    --accent-bg: rgba(217, 119, 6, 0.1);
    --accent-bg-hover: rgba(217, 119, 6, 0.2);
    --border-color: #e2e8f0;
    --link-color: #2563eb;
    --link-hover: #1d4ed8;
    --error-color: #dc2626;
    --error-bg: rgba(220, 38, 38, 0.1);
    --error-border: rgba(220, 38, 38, 0.3);
    --overlay-bg: rgba(0, 0, 0, 0.6);
    --shadow-color: rgba(0, 0, 0, 0.15);
    /* Escape method colors - brighter for light theme */
    --escape-direct: #059669;
    --escape-meta: #7c3aed;
    --escape-critical: #ea580c;
    --escape-humility: #2563eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 20px;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: var(--accent);
    margin-bottom: 6px;
    font-size: 28px;
}

h2 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 24px;
}

h3 {
    color: var(--accent);
    font-size: 16px;
    margin-bottom: 15px;
}

h4 {
    color: var(--text-primary);
    font-size: 13px;
    margin-bottom: 15px;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
    margin-top: -5px;
}

.intro {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.intro p {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
}

.lead-smaller {
    font-size: 1rem;
    margin-bottom: 12px;
}

.content-wrapper {
    position: relative;
    z-index: 1;
}

hr {
    border-color: var(--border-color);
    margin: 24px 0 20px 0;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.visible {
    display: flex;
}

.modal-content {
    background: var(--bg-modal);
    border: 2px solid var(--accent);
    border-radius: 8px;
    padding: 30px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px var(--shadow-color);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 20px;
}

.modal-close:hover {
    color: var(--accent);
}

.modal-meta {
    padding: 10px 0;
    margin-bottom: 12px;
}

.node-badge {
    font-size: 10px;
    font-weight: 600;
    color: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.modal-description {
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 15px;
}

.modal-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.modal-section-title {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.modal-link {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 8px;
}

.modal-link:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.modal p {
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 12px;
}

/* Interactive element styles */
.term-link {
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 1px dotted var(--accent);
    transition: all 0.2s;
}

.term-link:hover {
    color: var(--accent-hover);
    border-bottom-style: solid;
}

/* Button styles */
.btn {
    background: var(--accent-bg);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 600;
    padding: 10px 20px;
    font-size: 13px;
}

.btn:hover {
    background: var(--accent-bg-hover);
    color: var(--accent);
}

.btn:disabled {
    color: var(--text-muted);
    border-color: var(--border-color);
    background: var(--bg-secondary);
    cursor: not-allowed;
}

/* Links list styles */
.links-list {
    list-style: none;
    text-align: center;
    margin: 20px 0;
    padding: 0;
}

.links-list li {
    margin: 7px 0;
}

.links-list a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px dotted var(--accent);
    transition: all 0.2s;
}

.links-list a:hover {
    color: var(--accent-hover);
    border-bottom-style: solid;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.py-5 {
    padding-top: 1rem !important;
    padding-bottom: 2rem !important;
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .py-5 {
        padding-top: 0.5rem !important;
        padding-bottom: 1rem !important;
    }
    
    h1 {
        margin-bottom: 4px;
        font-size: 24px;
    }
    
    h4 {
        margin-bottom: 10px;
        font-size: 12px;
    }
    
    .intro {
        margin-bottom: 12px;
        padding: 15px;
    }
    
    .intro p {
        margin-bottom: 8px;
        font-size: 13px;
    }
    
    .links-list {
        margin: 15px 0;
    }
    
    .links-list li {
        margin: 6px 0;
    }
    
    .links-list a {
        font-size: 13px;
    }
    
    hr {
        margin: 18px 0 15px 0;
    }
    
    .lead-smaller {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
    
    .modal-content {
        max-width: 90vw;
        width: 90vw;
    }
}

/* Social Media Section */
.social-media-section {
    margin-top: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--accent-bg);
    color: var(--accent);
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icon:hover {
    background-color: var(--accent-bg-hover);
    color: var(--accent);
    transform: translateY(-3px);
}

.social-icon svg {
    width: 24px;
    height: 24px;
}

/* Logo */
.logo-link {
    position: absolute;
    top: 20px;
    left: 0;
    z-index: 100;
}

.logo-link a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    padding: 8px 12px;
    transition: all 0.2s;
}

.logo-link svg {
    width: 32px;
    height: 32px;
    fill: var(--accent);
}

.logo-link a:hover svg {
    fill: var(--accent-hover);
}

@media (max-width: 768px) {
    .logo-link {
        position: static;
        text-align: center;
        margin-bottom: 15px;
    }

    .logo-link a {
        display: inline-flex;
        justify-content: center;
    }
}

/* Status Messages */
.loading-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

.error-message {
    text-align: center;
    color: var(--error-color);
    padding: 40px;
    background: var(--error-bg);
    border-radius: 8px;
    border: 1px solid var(--error-border);
}

.empty-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Back Button */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.back-button:hover {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--accent);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.theme-toggle:hover {
    background: var(--accent-bg-hover);
    border-color: var(--accent);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.theme-toggle .moon-icon {
    display: none;
}

@media (max-width: 768px) {
    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 38px;
        height: 38px;
    }
    
    .theme-toggle svg {
        width: 18px;
        height: 18px;
    }
}
