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

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background-color: #000000;
    border: 2px solid #FFD700;
    border-radius: 8px;
    max-width: 600px;
    max-height: 80vh;
    width: min(90vw, 600px);
    padding: 0;
    overflow: hidden;
    z-index: 1001;
    color: #FFD700;
}

#info-content {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.modal-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background-color: #000000;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    min-height: 3rem;
    flex-shrink: 0;
}

.modal-menu-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    display: none;
}

.modal-close-inline {
    background: transparent;
    border: none;
    color: #FFD700;
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
    font-family: Arial, sans-serif;
}

.modal-close-inline:hover {
    color: #FFC700;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: #FFD700 #000000;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #000000;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #FFC700;
}

.modal-menu-btn {
    width: 1.5rem;
    height: 2rem;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0;
}

.menu-line {
    width: 100%;
    height: 2px;
    background-color: #FFD700;
}

.modal-menu-btn:hover,
.modal-menu-btn.menu-open {
    transform: rotate(-90deg);
}

.modal-menu-nav {
    display: flex;
    align-items: center;
    max-width: 0;
    overflow: hidden;
    transition: max-width 0.5s ease;
}

.modal-menu-nav:not(.hidden) {
    max-width: 200px;
}

.modal-menu-item {
    color: #FFD700;
    text-decoration: none;
    padding: 0;
    margin-left: 0.5rem;
    font-family: Monaco, Consolas, 'Courier New', monospace;
    font-size: clamp(1.1rem, 3vw, 1.35rem);
    font-weight: bold;
    white-space: nowrap;
    letter-spacing: 0;
    transition: letter-spacing 0.2s ease;
}

.modal-menu-item:hover {
    letter-spacing: 0.15rem;
    text-decoration: underline;
}

.modal-body h1 {
    color: #FFD700;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 0;
}

.modal-body h2 {
    color: #FFD700;
    font-size: 1.15rem;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

.modal-body h3 {
    color: #FFD700;
    font-size: 1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.modal-body p {
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.modal-body a {
    color: #FFD700;
    text-decoration: underline;
}

.modal-body a:hover {
    color: #FFC700;
}

.modal-body ul,
.modal-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.modal-body small {
    font-size: 0.85rem;
}

.modal-body .formula {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    background: rgba(255, 215, 0, 0.1);
    padding: 1em;
    border-left: 3px solid #FFD700;
    margin: 1em 0;
}

/* Mobile styles */
@media (max-width: 768px) {
    .modal-content {
        width: 95vw;
        max-height: 90vh;
    }

    #info-content {
        max-height: 90vh;
    }

    .modal-header {
        padding: 0.75rem 1rem;
        min-height: 2.5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-body h1 {
        font-size: 1.25rem;
    }

    .modal-body h2 {
        font-size: 1rem;
    }

    .modal-body p,
    .modal-body ul,
    .modal-body ol {
        font-size: 0.9rem;
    }
}
