/* JWT Decoder - Minimal Styles for Performance */
/* Critical CSS for LCP optimization */

/* CSS Reset & Base */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;line-height:1.6;color:#1f2937;background:#f9fafb}
h1,h2,h3,h4{line-height:1.3;font-weight:600}
a{color:#2563eb;text-decoration:none}
a:hover{text-decoration:underline}
button{cursor:pointer;border:none;border-radius:6px;font-family:inherit}

/* Layout */
.container{max-width:1200px;margin:0 auto;padding:0 1rem}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Header */
.header{background:#fff;border-bottom:1px solid #e5e7eb;position:sticky;top:0;z-index:100;box-shadow:0 1px 3px rgba(0,0,0,.1)}
.header .container{display:flex;align-items:center;justify-content:space-between;padding:1rem}
.logo{display:flex;align-items:center;gap:0.5rem;font-size:1.5rem;font-weight:700;color:#1f2937}
.logo-icon{font-size:1.8rem}
.language-switcher select{padding:0.5rem;border:1px solid #d1d5db;border-radius:6px;background:#fff;color:#374151;font-size:0.9rem}

/* Main Content */
.main{padding:2rem 0}

/* Hero Section */
.hero{text-align:center;margin-bottom:3rem}
.hero h2{font-size:2.5rem;margin-bottom:1rem;color:#111827}
.hero p{font-size:1.1rem;color:#6b7280;max-width:600px;margin:0 auto 1.5rem}
.security-badge{display:inline-flex;align-items:center;gap:0.5rem;background:#dcfce7;color:#166534;padding:0.5rem 1rem;border-radius:25px;font-weight:600;font-size:0.9rem}
.badge-icon{font-size:1.1rem}

/* JWT App */
.jwt-app{background:#fff;border-radius:12px;padding:2rem;box-shadow:0 4px 6px rgba(0,0,0,0.05);margin-bottom:3rem}
.tool-grid{display:grid;grid-template-columns:1fr;gap:1.5rem;margin-bottom:2rem}

/* Input Sections */
.input-section{position:relative}
.input-label{display:block;font-weight:600;margin-bottom:0.5rem;color:#374151}
.jwt-input,.jwk-input{width:100%;padding:0.75rem;border:2px solid #d1d5db;border-radius:8px;font-family:Monaco,Consolas,'Courier New',monospace;font-size:0.9rem;resize:vertical;transition:border-color 0.2s}
.jwt-input:focus,.jwk-input:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,0.1)}
.input-help{font-size:0.85rem;color:#6b7280;margin-top:0.25rem}

/* Output Section */
.output-section{position:relative}
.output-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem}
.output-header h3{color:#374151}
.copy-button{background:#2563eb;color:#fff;padding:0.5rem 1rem;border-radius:6px;font-size:0.9rem;transition:background 0.2s}
.copy-button:hover{background:#1d4ed8}
.jwt-output{background:#1f2937;color:#f9fafb;padding:1.5rem;border-radius:8px;overflow-x:auto;font-family:Monaco,Consolas,'Courier New',monospace;font-size:0.85rem;line-height:1.5;min-height:150px;white-space:pre-wrap;word-break:break-all}
.jwt-output .placeholder{color:#9ca3af;font-style:italic}

/* JWT Syntax Highlighting */
.jwt-header{color:#fbbf24}
.jwt-payload{color:#34d399}
.jwt-signature{color:#f87171}
.jwt-section-label{color:#a78bfa;font-weight:600;display:block;margin:1rem 0 0.5rem}
.jwt-key{color:#60a5fa}
.jwt-string{color:#a7f3d0}
.jwt-number{color:#fde047}
.jwt-boolean{color:#fb7185}
.jwt-null{color:#94a3b8}

/* Verification Status */
.verification-status{margin-top:1rem;padding:1rem;border-radius:8px;display:flex;align-items:center}
.verification-status.success{background:#dcfce7;border:1px solid #bbf7d0;color:#166534}
.verification-status.error{background:#fee2e2;border:1px solid #fecaca;color:#dc2626}
.verification-status.warning{background:#fef3c7;border:1px solid #fde68a;color:#d97706}
.status-content{display:flex;align-items:center;gap:0.5rem}
.status-icon{font-size:1.2rem}

/* Features Section */
.features{margin-bottom:3rem}
.features h3{text-align:center;font-size:2rem;margin-bottom:2rem;color:#111827}
.features-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:1.5rem}
.feature-card{background:#fff;padding:1.5rem;border-radius:12px;text-align:center;box-shadow:0 2px 4px rgba(0,0,0,0.05);border:1px solid #e5e7eb;transition:transform 0.2s,box-shadow 0.2s}
.feature-card:hover{transform:translateY(-2px);box-shadow:0 4px 8px rgba(0,0,0,0.1)}
.feature-icon{font-size:2.5rem;margin-bottom:1rem}
.feature-card h4{color:#374151;margin-bottom:0.5rem}
.feature-card p{color:#6b7280;font-size:0.9rem}

/* Articles Navigation */
.articles-nav{margin-bottom:3rem}
.articles-nav h3{text-align:center;font-size:2rem;margin-bottom:2rem;color:#111827}
.articles-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:1.5rem}
.article-link{display:block;background:#fff;padding:1.5rem;border-radius:12px;border:1px solid #e5e7eb;transition:transform 0.2s,box-shadow 0.2s;text-decoration:none}
.article-link:hover{transform:translateY(-2px);box-shadow:0 4px 8px rgba(0,0,0,0.1);text-decoration:none}
.article-link h4{color:#374151;margin-bottom:0.5rem}
.article-link p{color:#6b7280;font-size:0.9rem}

/* Author Profile */
.author-profile{background:#fff;padding:2rem;border-radius:12px;margin-bottom:3rem;border:1px solid #e5e7eb}
.author-profile h3{margin-bottom:1.5rem;color:#111827}
.author-info h4{color:#374151;margin-bottom:0.5rem}
.author-info p{color:#6b7280;margin-bottom:1rem}
.author-links a{display:inline-flex;align-items:center;gap:0.5rem;color:#2563eb;font-weight:600}

/* References */
.references{margin-bottom:3rem}
.references h3{margin-bottom:1rem;color:#111827}
.references-list{list-style:none}
.references-list li{margin-bottom:0.5rem}
.references-list a{color:#2563eb;font-weight:500}

/* Footer */
.footer{background:#1f2937;color:#d1d5db;padding:3rem 0 1rem}

.footer-bottom{text-align:center;color:#9ca3af;font-size:0.9rem}

/* Related Sites Section */
.related-sites-section{margin-bottom:2rem;padding:1.5rem 0;border-bottom:1px solid #e5e7eb}
.related-sites-section h3{color:#2563eb;margin-bottom:1rem;font-size:1.25rem}
.related-sites-section p{color:#6b7280;margin-bottom:1.5rem;text-align:center;font-size:0.9rem}
.sites-categories{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:1.5rem}
.category{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1rem}
.category h4{color:#2563eb;margin-bottom:0.75rem;font-size:1rem;font-weight:600;border-bottom:1px solid #e5e7eb;padding-bottom:0.5rem}
.sites-list{list-style:none;padding:0;margin:0}
.sites-list li{margin-bottom:0.5rem}
.sites-list a{color:#2563eb;text-decoration:none;font-size:0.9rem;transition:color 0.2s ease}
.sites-list a:hover{color:#1d4ed8;text-decoration:underline}
.current-site{color:#059669;font-weight:500;font-size:0.9rem}

/* Legal content */
.legal-content{margin-top:2rem;padding-top:2rem;border-top:1px solid #374151}
.legal-section{margin-bottom:2rem}
.legal-section h3{color:#fff;margin-bottom:1rem;font-size:1.2rem}
.legal-section h4{color:#d1d5db;margin:1rem 0 0.5rem;font-size:1rem}
.legal-text p{color:#9ca3af;line-height:1.6;margin-bottom:0.75rem}
.legal-text a{color:#60a5fa}
.legal-text a:hover{color:#93c5fd}


/* Responsive Design */
@media (min-width:768px){
    .tool-grid{grid-template-columns:1fr 1fr}
    .hero h2{font-size:3rem}
    .features-grid{grid-template-columns:repeat(2,1fr)}
}

@media (min-width:1024px){
    .features-grid{grid-template-columns:repeat(4,1fr)}
    .articles-grid{grid-template-columns:repeat(2,1fr)}
}

/* Mobile responsive for related sites */
@media (max-width:768px){
    .sites-categories{grid-template-columns:1fr;gap:1rem}
    .category{padding:0.75rem}
}

/* High Contrast Mode Support */
@media (prefers-contrast:high){
    .jwt-output{background:#000;color:#fff;border:2px solid #fff}
    .security-badge{background:#000;color:#fff;border:2px solid #0f0}
}

/* Reduced Motion Support */
@media (prefers-reduced-motion:reduce){
    *{animation-duration:0.01ms!important;animation-iteration-count:1!important;transition-duration:0.01ms!important}
}

/* Focus Indicators for Accessibility */
button:focus,input:focus,textarea:focus,select:focus,a:focus{outline:2px solid #2563eb;outline-offset:2px}

/* Loading States */
.loading{opacity:0.6;pointer-events:none;position:relative}
.loading::after{content:'';position:absolute;top:50%;left:50%;width:20px;height:20px;margin:-10px 0 0 -10px;border:2px solid #f3f3f3;border-top:2px solid #2563eb;border-radius:50%;animation:spin 1s linear infinite}

@keyframes spin{
    0%{transform:rotate(0deg)}
    100%{transform:rotate(360deg)}
}

/* Print Styles */
@media print{
    .header,.footer,.copy-button{display:none}
    .jwt-output{background:#fff;color:#000;border:1px solid #000}
    body{background:#fff}
}