/* RBPInsights - Modern SPA Stylesheet */
/* Based on RBPBlendedIndex design system */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    /* Two-tone background gradient */
    background: linear-gradient(to bottom,
        #1a2a4a 0%,
        #2a3a5a 10%,
        #3a4a6a 20%,
        #5a6a8a 30%,
        #7a8aaa 40%,
        #9aaaba 50%,
        #b0c0d0 60%,
        #c5d5e5 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* App Container - floating panel effect */
.app-container {
    max-width: 1115px;
    margin: 0 auto;
    padding: 80px 20px 80px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Panel wrapper */
.panel-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: #fff;
    padding: 15px 20px;
    text-align: left;
    border-radius: 4px 4px 0 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.logo img {
    max-width: 200px;
    height: auto;
}

/* Navigation */
.nav {
    background: linear-gradient(to bottom, #3d4a5c 0%, #2a3545 100%);
    padding: 0;
    margin-bottom: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0;
}

.nav-menu li {
    position: relative;
}

.nav-link {
    display: block;
    padding: 12px 20px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-right: 1px solid rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* Nav link hover animation - sweep effect */
.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-link.active {
    background: #1a2535;
    color: #fff;
    box-shadow: inset 0 -2px 0 #4a9eff;
}

/* Submenu */
.has-submenu:hover .submenu {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #2a3545;
    min-width: 200px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.submenu li {
    list-style: none;
}

.submenu li a {
    display: block;
    padding: 10px 15px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s ease;
    cursor: pointer;
}

.submenu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding-left: 20px;
}

/* Main Content */
.main-content {
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    border-radius: 0 0 4px 4px;
    min-height: 400px;
}

/* Sections with slide animation */
.section {
    display: none;
    opacity: 0;
}

.section.active {
    display: block;
    animation: slideIn 0.4s ease forwards;
}

.section.slide-out {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

/* Content Box */
.content-box {
    padding: 30px 40px;
}

.content-box h2 {
    color: #1a202c;
    font-size: 1.5rem;
    font-weight: normal;
    margin-bottom: 20px;
}

.content-box h3 {
    color: #2a3545;
    font-size: 1.2rem;
    margin-bottom: 15px;
    margin-top: 20px;
}

.content-box p {
    margin-bottom: 15px;
    color: #333;
    font-size: 15px;
    line-height: 1.7;
}

.content-box ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.content-box li {
    margin-bottom: 8px;
}

.content-box a {
    color: #5e8ab4;
    text-decoration: none;
    transition: color 0.2s;
}

.content-box a:hover {
    color: #3a6a94;
    text-decoration: underline;
}

/* Intro Section */
.intro-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.intro-image {
    flex-shrink: 0;
    width: 220px;
}

.intro-image img {
    max-width: 100%;
    height: auto;
}

.intro-text {
    flex: 1;
}

/* Contact Grid */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.contact-col h2 {
    margin-bottom: 15px;
}

.contact-col a {
    color: #5e8ab4;
    text-decoration: none;
    transition: color 0.2s;
}

.contact-col a:hover {
    color: #3a6a94;
    text-decoration: underline;
}

/* Document List */
.doc-list {
    list-style: none;
    margin-left: 0;
}

.doc-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.doc-list li:last-child {
    border-bottom: none;
}

.doc-list a {
    color: #5e8ab4;
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.doc-list a:hover {
    color: #3a6a94;
    text-decoration: underline;
}

.doc-list .pdf-icon {
    width: 20px;
    height: 20px;
}

/* FAQ Section */
.faq-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    font-weight: 600;
    color: #2a3545;
    margin-bottom: 10px;
}

/* Index Tool Section - Angular App Container */
#index-tool .content-box {
    padding: 15px 5px;
}

#index-tool-container {
    min-height: 600px;
    position: relative;
    overflow-x: auto;
}

.angular-loading {
    text-align: center;
    padding: 50px;
    color: #666;
}

.angular-loading img {
    width: 50px;
    height: 50px;
}

/* Disclaimer text (long form) */
.legal-text p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.legal-text strong {
    color: #1a202c;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.6);
    margin-top: 0;
    padding: 15px 20px;
    text-align: center;
    color: #1a1a2a;
    font-size: 11px;
    border-radius: 4px;
    backdrop-filter: blur(2px);
}

.footer-address {
    margin-bottom: 8px;
    font-weight: 500;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 10px;
    margin-top: 5px;
}

.footer-links a {
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    padding: 5px 15px;
    background: rgba(255,255,255,0.7);
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
}

.footer-links a:hover {
    background: rgba(255,255,255,0.9);
    text-decoration: none;
}

/* Loading spinner */
.loading {
    text-align: center;
    padding: 50px;
}

.loading img {
    width: 50px;
    height: 50px;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a2a4a 0%, #2a3a5a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
    transition: opacity 0.5s ease;
}

#preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

#preloader img {
    width: 50px;
}

/* Responsive */
@media (max-width: 768px) {
    .intro-content {
        flex-direction: column;
    }

    .intro-image {
        width: 100%;
        text-align: center;
    }

    .nav-menu {
        flex-direction: column;
    }

    .submenu {
        position: static;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .app-container {
        padding: 10px 10px 60px 10px;
    }

    .content-box {
        padding: 20px;
    }
}

/* Utility classes */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none !important; }

/* Superscript styling */
sup {
    font-size: 0.6em;
    vertical-align: super;
}

/* Glossary Panel */
.glossary-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background: rgba(42, 53, 69, 0.95);
    border-radius: 4px 4px 0 0;
    margin-top: 10px;
}

.glossary-panel.open {
    max-height: 500px;
    transition: max-height 0.4s ease-in;
}

.glossary-content {
    padding: 20px;
}

.glossary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.glossary-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.glossary-close:hover {
    opacity: 1;
}

.glossary-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.glossary-item {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.glossary-term {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    color: #4a9eff;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.glossary-term:hover {
    background: rgba(255,255,255,0.1);
}

.glossary-arrow {
    font-size: 10px;
    transition: transform 0.3s;
    color: #aaa;
}

.glossary-item.expanded .glossary-arrow {
    transform: rotate(180deg);
}

.glossary-definition {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    color: #ddd;
    font-size: 14px;
    line-height: 1.6;
    padding: 0 15px;
    background: rgba(0,0,0,0.2);
}

.glossary-item.expanded .glossary-definition {
    max-height: 200px;
    padding: 12px 15px;
}

.glossary-toggle {
    cursor: pointer;
}

/* Responsive glossary */
@media (max-width: 768px) {
    .glossary-content {
        padding: 15px;
    }

    .glossary-items {
        gap: 8px;
    }

    .glossary-term {
        padding: 10px 12px;
        font-size: 14px;
    }

    .glossary-definition {
        font-size: 13px;
    }
}
