/* ============================================
   Framework Reference Pages - CSS
   ============================================ */

/* Framework Hero */
.framework-hero {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
    color: var(--white);
    padding: 6rem 0 4rem;
    text-align: center;
}

.framework-hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.framework-hero .hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.framework-hero .hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.framework-hero .stat-box {
    background: rgba(255, 255, 255, 0.15);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.framework-hero .stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--secondary-color);
}

.framework-hero .stat-label {
    display: block;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    opacity: 0.9;
}

/* Search Section */
.search-section {
    background: var(--bg-light);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.search-bar {
    display: flex;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.search-bar input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    transition: var(--transition-base);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.search-bar button {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.search-bar button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

#searchResults {
    margin-top: 2rem;
}

.search-result-item {
    background: var(--white);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    cursor: pointer;
    transition: var(--transition-base);
}

.search-result-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

.search-result-id {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
}

.search-result-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.search-result-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.search-result-mapping {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 102, 204, 0.05);
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Content Layout */
.framework-content {
    padding: 3rem 0;
}

.content-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
}

/* Sidebar TOC */
.toc-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.toc-sidebar h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.toc {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.toc-link {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition-base);
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.toc-link:hover {
    background: var(--bg-light);
    border-left-color: var(--primary-color);
}

.toc-link.active {
    background: rgba(0, 102, 204, 0.1);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.toc-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Main Content */
.main-content {
    max-width: 900px;
}

.intro-section {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
}

.intro-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.intro-section h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.intro-section ul {
    margin-left: 2rem;
    margin-top: 1rem;
}

.intro-section li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

/* Category Sections */
.category-section {
    margin-bottom: 4rem;
}

.category-section h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.category-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Controls Grid */
.controls-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-card {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition-base);
}

.control-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.control-id {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.1rem;
}

.control-expand {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.control-expand:hover {
    transform: scale(1.2);
}

.control-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.control-objective {
    background: rgba(0, 102, 204, 0.05);
    padding: 1rem;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    margin-bottom: 1rem;
    font-style: italic;
}

.control-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.control-details {
    display: none;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.control-details.expanded {
    display: block;
}

.control-details h4 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.control-details ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.control-details li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.nis2-mapping-badge {
    display: inline-block;
    background: linear-gradient(135deg, #06D6A0, #00B4D8);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 1rem;
}

/* Mapping Table */
.mapping-section {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-top: 3rem;
}

.mapping-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.mapping-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}

.mapping-table th,
.mapping-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.mapping-table th {
    background: var(--dark-bg);
    color: var(--white);
    font-weight: 600;
}

.mapping-table tr:hover {
    background: var(--bg-light);
}

.coverage {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
}

.coverage.high {
    background: rgba(6, 214, 160, 0.2);
    color: #047857;
}

.coverage.medium {
    background: rgba(255, 183, 3, 0.2);
    color: #D97706;
}

.coverage.low {
    background: rgba(239, 71, 111, 0.2);
    color: #DC2626;
}

.coverage-summary {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 102, 204, 0.05);
    border-radius: 8px;
}

.coverage-summary h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.coverage-summary ul {
    margin-left: 1.5rem;
    margin-top: 1rem;
}

/* Print Styles */
@media print {
    .navbar,
    .search-section,
    .toc-sidebar,
    .footer {
        display: none !important;
    }

    .content-layout {
        grid-template-columns: 1fr;
    }

    .control-card {
        page-break-inside: avoid;
        border: 1px solid #ccc;
    }

    .control-details {
        display: block !important;
    }

    .control-expand {
        display: none;
    }

    @page {
        margin: 2cm;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .content-layout {
        grid-template-columns: 1fr;
    }

    .toc-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .framework-hero h1 {
        font-size: 2.5rem;
    }

    .framework-hero .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .search-bar {
        flex-direction: column;
    }

    .mapping-table {
        font-size: 0.85rem;
    }

    .mapping-table th,
    .mapping-table td {
        padding: 0.75rem 0.5rem;
    }
}
