/* Critical CSS - Above the fold styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global Paragraph Justification - All Devices */
p {
    text-align: justify;
    line-height: 1.6;
}

/* Specific Content Section Justification */
.content-article p,
.guidance-content p,
.toc-content p,
.about-content p,
.how-to-use-section p,
.faq-content p,
.accordion-content p,
.nic-type-card p,
.usage-card p,
.benefit-card p,
.characteristic-item p,
.step-item p,
.info-box p,
.example p,
.result-description,
.result-suggestion-text {
    text-align: justify;
    line-height: 1.6;
}

/* Long Paragraph Justification - All Content Areas */
section p,
article p,
div p,
.hero p,
.footer p,
.ad-placement p {
    text-align: justify;
    line-height: 1.6;
}

/* Highlight Box Text Color - White text on dark backgrounds */
.highlight-box,
.highlight-box h3,
.highlight-box p,
.highlight-box ul,
.highlight-box li {
    color: white !important;
}

.highlight-box i {
    color: white !important;
}

/* Section Padding - Top and Bottom Only */
.content-section {
    padding: 40px 0;
}

.search-guidance-section {
    padding: 40px 0;
}

.toc-section {
    padding: 40px 0;
}

/* Desktop Navigation */
.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 12px;
    border-radius: 6px;
}

.nav-link:hover {
    color: #3B82F6;
    background-color: rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

/* Navigation Active State */
.nav-link.active {
    color: #3B82F6 !important;
    font-weight: 600;
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: #3B82F6;
    border-radius: 1px;
}

/* Mobile Menu Toggle - Hidden on Desktop */
.mobile-menu-toggle {
    display: none;
}

/* Ensure navbar is positioned correctly for mobile menu */
.navbar {
    position: relative;
}

/* Legal Pages Styling */
.main-content {
    padding: 40px 0;
    min-height: 60vh;
}

.last-updated {
    color: #666;
    font-style: italic;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.privacy-section,
.terms-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.privacy-section:last-child,
.terms-section:last-child {
    border-bottom: none;
}

.privacy-section h2,
.terms-section h2 {
    color: #1E3A8A;
    font-size: 1.8rem;
    margin-bottom: 20px;
    margin-top: 30px;
}

.privacy-section h3,
.terms-section h3 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 15px;
    margin-top: 25px;
}

.privacy-section p,
.terms-section p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.privacy-section ul,
.terms-section ul {
    margin-bottom: 20px;
    padding-left: 25px;
}

.privacy-section li,
.terms-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.contact-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.contact-info p {
    margin-bottom: 10px;
    font-weight: 500;
}

.contact-info p:last-child {
    margin-bottom: 0;
}

/* Mobile Legal Pages */
@media (max-width: 768px) {
    .main-content {
        padding: 20px 0;
    }
    
    .privacy-section h2,
    .terms-section h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .privacy-section h3,
    .terms-section h3 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    
    .privacy-section,
    .terms-section {
        margin-bottom: 30px;
        padding-bottom: 20px;
    }
}

/* Performance optimizations */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Account for fixed header */
}

body {
    font-display: swap;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    will-change: auto;
}

/* Optimize for better performance */
* {
    box-sizing: border-box;
}

/* Reduce layout thrashing */
.accordion-item,
.accordion-content,
.nav-links {
    contain: layout style;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for accessibility */
.nav-link:focus,
.accordion-header:focus,
button:focus,
input:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .accordion-header {
        border: 2px solid #000;
    }
    
    .nav-link {
        border: 1px solid #000;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: #1E3A8A;
    color: white;
    padding: 5px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    text-align: left;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 3px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.tagline {
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 300;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 20px;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    height: 50vh;
    display: flex;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 25px;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Container */
.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-box {
    position: relative;
    background: white;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #1E3A8A;
    font-size: 1.2rem;
    z-index: 2;
}

#searchInput {
    width: 100%;
    padding: 20px 60px 20px 60px;
    border: none;
    outline: none;
    font-size: 1.1rem;
    background: transparent;
    color: #333;
}

#searchInput::placeholder {
    color: #999;
}

.clear-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #f0f0f0;
    color: #666;
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
}

.search-guidance-note {
    margin-top: 15px;
    padding: 0;
    background: transparent;
    color: white;
    text-align: center;
    font-size: 0.9rem;
    width: 100%;
    max-width: none;
}

.search-guidance-note p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.search-guidance-note i {
    font-size: 1rem;
}

.search-ad {
    margin-top: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suggestion-item:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: translateX(2px);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-class {
    font-weight: 600;
    color: #1E3A8A;
    font-size: 0.95rem;
}

.suggestion-subclass {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* Results Section */
.results-section {
    padding: 60px 0;
    background: white;
    display: block !important;
    visibility: visible !important;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 20px;
}

.results-title-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.results-header h3 {
    font-size: 1.8rem;
    color: #333;
    font-weight: 600;
    margin: 0;
}

.results-count {
    color: #1E3A8A;
    font-weight: 500;
    font-size: 1.1rem;
}

.view-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.view-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #666;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.view-btn:hover {
    background: #e9ecef;
    border-color: #1E3A8A;
    color: #1E3A8A;
}

.view-btn.active {
    background: #1E3A8A;
    border-color: #1E3A8A;
    color: white;
}

.results-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 100px;
}

.results-grid.list-view {
    grid-template-columns: 1fr;
    gap: 15px;
}

.results-grid.list-view .result-card {
    display: flex;
    align-items: center;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.results-grid.list-view .result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.results-grid.list-view .result-class {
    font-size: 1.2rem;
    margin-bottom: 0;
    margin-right: 20px;
    min-width: 120px;
    text-align: center;
    background: #1E3A8A;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
}

.results-grid.list-view .result-subclass {
    font-size: 1rem;
    margin-bottom: 0;
    margin-right: 20px;
    min-width: 150px;
    font-weight: 600;
    color: #333;
}

.results-grid.list-view .result-description {
    flex: 1;
    margin: 0;
    color: #666;
    line-height: 1.5;
}

.result-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 150px;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: #1E3A8A;
}

.result-class {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1E3A8A;
    margin-bottom: 8px;
}

.result-subclass {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.result-description {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* New result card structure styles */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #1E3A8A;
    gap: 20px;
}

.result-code-section, .result-subcode-section {
    flex: 1;
    text-align: center;
}

.result-code-label, .result-subcode-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.result-code {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1E3A8A;
    margin: 0;
}

.result-subcode {
    font-size: 1.2rem;
    font-weight: 600;
    color: #3B82F6;
    background: #f0f8ff;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 0;
}

.result-content {
    margin-bottom: 15px;
}

.result-description-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.result-description {
    font-size: 1rem;
    color: #333;
    line-height: 1.5;
    margin-bottom: 15px;
}

.result-suggestion {
    background: #e8f5e8;
    border: 1px solid #10B981;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
}

.result-suggestion-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #10B981;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.result-suggestion-text {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
}

.result-suggestion {
    background: #e8f5e8;
    color: #10B981;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    border-left: 4px solid #10B981;
    margin-top: 10px;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
    margin-top: 15px;
}

.result-meta-item {
    flex: 1;
    text-align: center;
}

.result-meta-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.result-meta-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1E3A8A;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Breadcrumb Navigation */
.breadcrumb {
    background: #f8f9fa;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9rem;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
}

.breadcrumb-list li:not(:last-child)::after {
    content: '›';
    margin-left: 10px;
    color: #7f8c8d;
    font-weight: bold;
}

.breadcrumb-list a {
    color: #1E3A8A;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-list a:hover {
    color: #2c3e50;
    text-decoration: underline;
}

.breadcrumb-list span {
    color: #7f8c8d;
}

/* Table of Contents */
/* Search Guidance Section */
.search-guidance-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.guidance-content h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: #333;
    font-weight: 700;
}

.guidance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.guidance-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.guidance-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.guidance-icon {
    width: 60px;
    height: 60px;
    background: #1E3A8A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 1.5rem;
}

.guidance-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.guidance-card p {
    color: #666;
    line-height: 1.6;
}

.guidance-note {
    background: #10B981;
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-top: 30px;
}

.guidance-note p {
    margin: 0;
    font-size: 1.1rem;
}

.toc-section {
    padding: 60px 0;
    background: #f8f9fa;
}

/* Center all H2 headings */
h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: #333;
    font-weight: 700;
}

.toc-content h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: #333;
    font-weight: 700;
}

.toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.toc-item a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 2px solid transparent;
}

.toc-item a:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: #1E3A8A;
    color: #1E3A8A;
}

.toc-item i {
    font-size: 1.5rem;
    color: #1E3A8A;
}

.toc-item span {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Content Sections */
.content-section {
    padding: 80px 0;
    background: white;
}

.content-section:nth-child(even) {
    background: #f8f9fa;
}

.content-article h1 {
    font-size: 2.8rem;
    color: #333;
    margin-bottom: 30px;
    font-weight: 700;
    line-height: 1.2;
}

.content-article h2 {
    font-size: 2.2rem;
    color: #333;
    margin-bottom: 25px;
    font-weight: 600;
    line-height: 1.3;
}

.content-article p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 20px;
}

.content-article ul {
    margin: 20px 0;
    padding-left: 30px;
}

.content-article li {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 10px;
}

/* Highlight Box */
.highlight-box {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.highlight-box.important-update {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
    border-left: 5px solid #ff4757;
}

.highlight-box h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.highlight-box p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Info Box */
.info-box {
    background: #e3f2fd;
    border-left: 5px solid #2196f3;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
}

.info-box p {
    margin: 0;
    color: #1565c0;
    font-weight: 500;
    text-align: justify;
    line-height: 1.6;
}

/* NIC Types Grid */
.nic-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.nic-type-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.nic-type-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border-color: #1E3A8A;
}

.nic-type-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.nic-type-number {
    background: #1E3A8A;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
}

.nic-type-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
}

.nic-type-card p {
    margin-bottom: 15px;
    color: #666;
    text-align: justify;
    line-height: 1.6;
}

.example {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-size: 0.95rem;
    text-align: justify;
    line-height: 1.5;
}

/* Usage Grid */
.usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.usage-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.usage-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border-color: #1E3A8A;
}

.usage-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
}

.usage-icon i {
    font-size: 2rem;
    color: white;
}

.usage-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #333;
}

.usage-card p {
    color: #666;
    line-height: 1.6;
    text-align: justify;
}

/* Characteristics List */
.characteristics-list {
    margin: 40px 0;
}

.characteristic-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.characteristic-item:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.characteristic-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.characteristic-icon i {
    font-size: 1.5rem;
    color: white;
}

.characteristic-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #333;
}

.characteristic-content p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* Benefits Grid */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.benefit-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.benefit-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border-color: #1E3A8A;
}

.benefit-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
}

.benefit-icon i {
    font-size: 2rem;
    color: white;
}

.benefit-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #333;
}

.benefit-card p {
    color: #666;
    line-height: 1.6;
    text-align: justify;
}

/* Steps Guide */
.steps-guide {
    margin: 40px 0;
}

.step-guide {
    display: flex;
    align-items: flex-start;
    gap: 25px;
    padding: 30px;
    background: white;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.step-guide:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.step-guide .step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-guide .step-content h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #333;
}

.step-guide .step-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.step-guide ul {
    margin: 15px 0;
    padding-left: 25px;
}

.step-guide li {
    color: #666;
    margin-bottom: 8px;
}

/* FAQ Section */
.faq-container {
    margin: 40px 0;
}

.faq-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.faq-question:hover {
    background: #e9ecef;
}

.faq-question h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
    font-weight: 600;
}

.faq-question i {
    color: #1E3A8A;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 25px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: 25px;
    max-height: 200px;
}

.faq-answer p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

/* NIC Code List */
.nic-code-list {
    margin: 40px 0;
}

.nic-section {
    margin-bottom: 40px;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border-left: 5px solid #667eea;
}

.nic-section h3 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 25px;
    font-weight: 700;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 15px;
}

.nic-division {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.nic-division h4 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.nic-division ul {
    margin: 0;
    padding-left: 20px;
}

.nic-division li {
    color: #555;
    margin-bottom: 8px;
    font-size: 1rem;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.nic-division li:hover {
    color: #1E3A8A;
}

/* Ad Placements */
.ad-placement {
    margin: 40px 0;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #bdc3c7;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.ad-placement:hover {
    border-color: #1E3A8A;
    background: #e3f2fd;
}

.ad-content p {
    font-size: 1.2rem;
    color: #1E3A8A;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.ad-content small {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.ad-banner {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Professional Color Scheme Updates */
:root {
    --primary-color: #1E3A8A;
    --secondary-color: #FFFFFF;
    --accent-color: #6B7280;
    --highlight-sky: #3B82F6;
    --highlight-emerald: #10B981;
    --light-bg: #f8f9fa;
    --dark-text: #1E3A8A;
    --medium-text: #555;
    --light-text: #7f8c8d;
}

/* Updated Header Colors - Removed conflicting styles */

/* Updated Hero Colors */
.hero {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

/* Updated Button Colors */
.view-btn.active {
    background: #2c3e50;
    border-color: #2c3e50;
}

.view-btn:hover {
    border-color: #2c3e50;
    color: #2c3e50;
}

/* Updated Result Card Colors */
.result-class {
    color: #2c3e50;
}

/* Updated Footer Colors */
.footer {
    background: #2c3e50;
}

.footer-section h3 {
    color: #3498db;
}

.social-link:hover {
    background: #3498db;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.4);
}

.back-to-top.show {
    display: flex;
}

/* Performance Optimizations */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* Lazy Loading for Images */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[data-src].loaded {
    opacity: 1;
}

/* About Section */
.about-section {
    padding: 80px 0;
    background: white;
}

.about-content h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #333;
    font-weight: 700;
}

.about-content > p {
    text-align: center;
    font-size: 1.2rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto 60px;
    line-height: 1.8;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.feature-card {
    text-align: center;
    padding: 40px 30px;
    border-radius: 15px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    background: white;
}

.feature-card i {
    font-size: 3rem;
    color: #1E3A8A;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* How to Use Section */
.how-to-use-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.how-to-use-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: #333;
    font-weight: 700;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.step:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
}

.step-content p {
    color: #666;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #1E3A8A;
    font-weight: 600;
}

.footer-section h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #ecf0f1;
    font-weight: 600;
}

.footer-section p {
    color: #bdc3c7;
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #1E3A8A;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-link {
    width: 40px;
    height: 40px;
    background: #34495e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #1E3A8A;
    transform: translateY(-3px);
}

.contact-info p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.contact-info i {
    color: #1E3A8A;
    width: 20px;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 20px;
    text-align: center;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom p {
    color: #95a5a6;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .navbar {
        flex-wrap: wrap;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    #searchInput {
        padding: 18px 50px 18px 50px;
        font-size: 1rem;
    }
    
    .search-icon {
        left: 15px;
    }
    
    .clear-btn {
        right: 15px;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .result-card {
        padding: 20px;
    }
    
    .about-content h2 {
        font-size: 2rem;
    }
    
    .about-content > p {
        font-size: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .feature-card {
        padding: 30px 20px;
    }
    
    .how-to-use-section h2 {
        font-size: 2rem;
    }
    
    .steps-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
        padding: 25px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .view-controls {
        align-self: flex-end;
    }
    
    .results-grid.list-view .result-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .results-grid.list-view .result-class,
    .results-grid.list-view .result-subclass {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .toc-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .content-article h1 {
        font-size: 2.2rem;
    }
    
    .content-article h2 {
        font-size: 1.8rem;
    }
    
    .nic-types-grid,
    .usage-grid,
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .characteristic-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .step-guide {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .faq-question h3 {
        font-size: 1.1rem;
    }
    
    .nic-section {
        padding: 20px;
    }
    
    .nic-section h3 {
        font-size: 1.5rem;
    }
    
    .nic-division {
        padding: 15px;
    }
    
    .nic-division h4 {
        font-size: 1.1rem;
    }
    
    .ad-placement {
        margin: 30px 0;
        padding: 15px;
    }
    
    .ad-banner {
        min-height: 100px;
    }
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 15px;
}

.skeleton-text {
    height: 20px;
    width: 100%;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Error States */
.error-message {
    background: #fee;
    color: #c33;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    margin: 20px 0;
    text-align: center;
}

.error-message i {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Focus States for Accessibility */
button:focus,
input:focus,
a:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #2c3e50;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero {
        padding: 40px 0;
    }
    
    #searchInput {
        padding: 16px 45px 16px 45px;
        font-size: 0.95rem;
    }
    
    .result-card {
        padding: 15px;
    }
    
    .result-class {
        font-size: 1.3rem;
    }
}

/* Animation for results */
.result-card {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accordion Styles */
.nic-accordion {
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

/* Ensure proper spacing between accordion items */
.accordion-item + .accordion-item {
    margin-top: 15px;
}

.accordion-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
    background: white;
    isolation: isolate;
}

.accordion-header {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%) !important;
    color: white !important;
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.accordion-header:hover {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%) !important;
}

.accordion-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
}

.accordion-header i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    color: white;
}

.accordion-item.active .accordion-header i {
    transform: rotate(180deg);
}

.accordion-content {
    background: white;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.accordion-item.active .accordion-content {
    max-height: 2000px;
    padding: 20px;
}

.division-item {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.division-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.division-item h4 {
    color: #1E3A8A;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3B82F6;
}

.group-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
}

.group-item {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 3px solid #10B981;
    font-size: 0.95rem;
    color: #333;
    transition: all 0.2s ease;
}

.group-item:hover {
    background: #e8f5e8;
    transform: translateX(5px);
}

/* No results state */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.no-results p {
    font-size: 1rem;
    color: #666;
}

/* Ensure white text on dark/colorful backgrounds */
.accordion-header,
.accordion-header h3,
.accordion-header i,
.accordion-header span,
.accordion-header div {
    color: white !important;
}

/* Force consistent accordion header background */
.accordion-item .accordion-header {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%) !important;
}

.accordion-item .accordion-header:hover {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%) !important;
}

/* Additional specificity to override any conflicting styles */
.nic-accordion .accordion-item .accordion-header {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%) !important;
}

.nic-accordion .accordion-item .accordion-header:hover {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%) !important;
}

.nic-accordion .accordion-item .accordion-header:focus {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%) !important;
}

.nic-accordion .accordion-item .accordion-header:active {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%) !important;
}

/* Ultimate fix for accordion header consistency */
.accordion-item:nth-child(1) .accordion-header,
.accordion-item:nth-child(2) .accordion-header,
.accordion-item:nth-child(3) .accordion-header,
.accordion-item:nth-child(4) .accordion-header,
.accordion-item:nth-child(5) .accordion-header,
.accordion-item:nth-child(6) .accordion-header,
.accordion-item:nth-child(7) .accordion-header,
.accordion-item:nth-child(8) .accordion-header,
.accordion-item:nth-child(9) .accordion-header,
.accordion-item:nth-child(10) .accordion-header,
.accordion-item:nth-child(11) .accordion-header,
.accordion-item:nth-child(12) .accordion-header,
.accordion-item:nth-child(13) .accordion-header,
.accordion-item:nth-child(14) .accordion-header,
.accordion-item:nth-child(15) .accordion-header,
.accordion-item:nth-child(16) .accordion-header,
.accordion-item:nth-child(17) .accordion-header,
.accordion-item:nth-child(18) .accordion-header,
.accordion-item:nth-child(19) .accordion-header,
.accordion-item:nth-child(20) .accordion-header,
.accordion-item:nth-child(21) .accordion-header {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%) !important;
}

/* Fix for Section D onwards background bleeding */
.accordion-item:nth-child(4) {
    background: white !important;
    isolation: isolate !important;
}

.accordion-item:nth-child(4) .accordion-content {
    background: white !important;
    isolation: isolate !important;
}

/* Ensure all accordion items have proper background isolation */
.accordion-item {
    background: white !important;
    isolation: isolate !important;
}

.accordion-item .accordion-content {
    background: white !important;
    isolation: isolate !important;
}

/* General rule for any element with dark gradient background */
[class*="gradient"] h1,
[class*="gradient"] h2,
[class*="gradient"] h3,
[class*="gradient"] h4,
[class*="gradient"] h5,
[class*="gradient"] h6,
[class*="gradient"] p,
[class*="gradient"] span,
[class*="gradient"] div {
    color: white !important;
}

/* Mobile Typography Optimization - H2 and H3 headings */
@media (max-width: 768px) {
    /* H2 Mobile Optimization */
    h2 {
        font-size: 25px !important;
        margin-bottom: 25px !important;
        line-height: 1.3 !important;
    }
    
    /* H3 Mobile Optimization */
    h3 {
        font-size: 20px !important;
        margin-bottom: 20px !important;
        line-height: 1.3 !important;
    }
    
    /* Specific overrides for different H2 contexts */
    .guidance-content h2,
    .toc-content h2,
    .content-article h2,
    .about-content h2,
    .how-to-use-section h2 {
        font-size: 25px !important;
        margin-bottom: 25px !important;
    }
    
    /* Specific overrides for different H3 contexts */
    .accordion-header h3,
    .nic-type-header h3,
    .usage-card h3,
    .benefit-card h3,
    .characteristic-item h3,
    .step-item h3,
    .faq-item h3 {
        font-size: 20px !important;
        margin-bottom: 15px !important;
    }
    
    /* Mobile Layout Optimizations */
    .container {
        padding: 0 15px;
    }
    
    /* Mobile Hero Section */
    .hero {
        padding: 30px 0;
        height: auto;
        min-height: 50vh;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    /* Mobile Search Box */
    .search-container {
        margin: 20px 0;
    }
    
    .search-box {
        padding: 12px 15px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Mobile Cards */
    .nic-type-card,
    .usage-card,
    .benefit-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    /* Mobile Grids */
    .nic-types-grid,
    .usage-grid,
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Mobile Accordion */
    .accordion-header {
        padding: 15px;
    }
    
    .accordion-content {
        padding: 15px;
    }
    
    /* Mobile Navigation */
    .navbar {
        padding: 10px 0;
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .nav-brand {
        flex: 1;
    }
    
    /* Mobile Navigation Links */
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1E3A8A;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 1000;
        border-radius: 0 0 8px 8px;
    }
    
    .nav-links.active {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Show Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Mobile Menu Toggle - White Color */
    .mobile-menu-toggle span {
        background: white !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    }
    
    .mobile-menu-toggle:hover span {
        background: #f0f0f0 !important;
    }
    
    .nav-link {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        font-size: 14px;
        display: block;
        width: 100%;
        text-align: left;
        color: white !important;
        transition: background-color 0.3s ease;
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .nav-link:hover {
        background-color: rgba(255,255,255,0.1);
        color: white !important;
    }
    
    .nav-link.active {
        background-color: rgba(255,255,255,0.2);
        color: white !important;
    }
    
    /* Mobile Menu Toggle Animation */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        padding: 5px;
    }
    
    .mobile-menu-toggle span {
        width: 25px;
        height: 3px;
        background: #333;
        margin: 3px 0;
        transition: 0.3s;
        border-radius: 2px;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    /* Mobile Footer */
    .footer {
        padding: 30px 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: left;
    }
    
    .footer-section h3,
    .footer-section h4 {
        text-align: left;
        margin-bottom: 15px;
        color: white !important;
    }
    
    .footer-links {
        text-align: left;
    }
    
    .footer-links li {
        margin-bottom: 8px;
    }
    
    .contact-info {
        text-align: left;
    }
    
    .social-links {
        text-align: left;
        margin-top: 15px;
    }
    
    /* Mobile Buttons */
    .btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px; /* Touch-friendly */
    }
    
/* Mobile Text Sizes */
p {
    font-size: 14px;
    line-height: 1.6;
    text-align: justify;
}

/* Mobile Content Justification */
.content-article p,
.guidance-content p,
.toc-content p,
.about-content p,
.how-to-use-section p,
.faq-content p,
.accordion-content p,
.nic-type-card p,
.usage-card p,
.benefit-card p,
.characteristic-item p,
.step-item p,
.info-box p,
.example p,
.result-description,
.result-suggestion-text {
    text-align: justify;
    line-height: 1.6;
}
    
    .search-guidance-note {
        font-size: 0.85rem;
        padding: 0 10px;
    }
    
    /* Mobile Results */
    .results-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .result-card {
        padding: 20px;
    }
    
    /* Mobile Back to Top */
    .back-to-top {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
}

/* Extra Small Mobile Devices (≤480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
    }
    
    h2 {
        font-size: 22px !important;
    }
    
    h3 {
        font-size: 18px !important;
    }
    
    .search-box {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .nic-type-card,
    .usage-card,
    .benefit-card {
        padding: 15px;
    }
    
    .accordion-header {
        padding: 12px;
    }
    
    .accordion-content {
        padding: 12px;
    }
    
    .result-card {
        padding: 15px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    p {
        font-size: 13px;
        text-align: justify;
    }
    
    /* Extra Small Mobile Content Justification */
    .content-article p,
    .guidance-content p,
    .toc-content p,
    .about-content p,
    .how-to-use-section p,
    .faq-content p,
    .accordion-content p,
    .nic-type-card p,
    .usage-card p,
    .benefit-card p,
    .characteristic-item p,
    .step-item p,
    .info-box p,
    .example p,
    .result-description,
    .result-suggestion-text {
        text-align: justify;
        line-height: 1.6;
    }
}

/* Mobile Landscape Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 40vh;
        padding: 20px 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .hero-description {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
}
