/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Performance optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #4299E1;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1001;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2D3748;
    background-color: #FAFAFA;
    padding-top: 80px; /* Account for fixed navbar */
    font-display: swap;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(26, 32, 44, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: #FBD38D;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link:focus {
    color: #FBD38D;
    outline: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #FBD38D;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link:focus::after {
    width: 100%;
}

.nav-link.active {
    color: #FBD38D;
}

.nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    background: none;
    border: none;
    color: inherit;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.9);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.hamburger.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Typography */
h1, h2, h3 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    text-align: center;
    margin-bottom: 3rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: #4A5568;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1;
}

.btn:focus {
    outline: 2px solid #4299E1;
    outline-offset: 2px;
}

.btn-primary {
    background-color: #4299E1;
    color: white;
    border-color: #4299E1;
}

.btn-primary:hover {
    background-color: #3182CE;
    border-color: #3182CE;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: #4299E1;
    border-color: #4299E1;
}

.btn-secondary:hover {
    background-color: #4299E1;
    color: white;
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: #E2E8F0;
    border-color: #E2E8F0;
}

.btn-outline:hover {
    background-color: #2D3748;
    color: white;
    border-width: 2px;
    transform: translateY(-2px);
}

.btn-dark {
    background-color: #fff;
    color: #2D3748;
    border-color: #2D3748;
}

/* Badge actions */
.badge-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.badge-actions .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    min-width: 120px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8rem 0 6rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 55, 72, 0.3);
    z-index: 1;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.1;
}

.hero-title .accent {
    color: #FBD38D;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    max-width: 500px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: 400;
    color: #fff;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.sample-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Why Section */
.why-section {
    padding: 8rem 0;
    background-color: white;
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.why-card {
    text-align: center;
    padding: 2.5rem;
    border-radius: 16px;
    background: #F7FAFC;
    border: 1px solid #E2E8F0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.why-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.why-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.why-card h3 {
    color: #2D3748;
    margin-bottom: 1rem;
}

/* Badges Section */
.badges-section {
    padding: 8rem 0;
    background: linear-gradient(to bottom, #F7FAFC, #EDF2F7);
}

.section-subtitle {
    text-align: center;
    font-size: 1.25rem;
    color: #4A5568;
    max-width: 600px;
    margin: 0 auto 4rem;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 4rem;
}

.badge-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #E2E8F0;
}

.badge-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.badge-preview {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.badge-preview svg,
.badge-preview object {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    max-width: 100%;
    height: auto;
}

.badge-preview object {
    width: 100%;
    max-width: 300px;
    height: auto;
    min-height: 40px;
}

.badge-card h3 {
    margin-bottom: 1rem;
    color: #2D3748;
}

.badge-card p {
    margin-bottom: 1.5rem;
    color: #4A5568;
}

.badge-code {
    background: #F7FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.badge-code pre {
    background: #2D3748;
    padding: 0.75rem;
    border-radius: 6px;
    margin: 0;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.badge-code code {
    color: #68D391;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* How to Use Section */
.how-to-section {
    padding: 8rem 0;
    background-color: white;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4299E1, #3182CE);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 auto 1.5rem;
}

.code-example {
    background: #1A202C;
    padding: 2rem;
    border-radius: 12px;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.code-example h3 {
    color: white;
    margin-bottom: 1rem;
}

.code-example pre {
    background: #2D3748;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.code-example code {
    color: #68D391;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
}

.copy-code-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Code Tabs */
.code-tabs {
    margin-top: 1rem;
}

.tab-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.tab-btn:hover,
.tab-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.code-snippets {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.code-snippet {
    background: #2D3748;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #4A5568;
}

.code-snippet h5 {
    color: #E2E8F0;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.code-snippet pre {
    background: #1A202C;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    overflow-x: auto;
}

.code-snippet code {
    color: #68D391;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Footer */
.footer {
    background-color: #1A202C;
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand h3 {
    color: #FBD38D;
    margin-bottom: 1rem;
}

.footer-brand p {
    color: #A0AEC0;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links a {
    color: #A0AEC0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover,
.footer-links a:focus {
    color: #FBD38D;
    outline: none;
}

.footer-bottom {
    border-top: 1px solid #2D3748;
    padding-top: 2rem;
    text-align: center;
}

.footer-bottom p {
    color: #718096;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background: rgba(26, 32, 44, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 1.5rem;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hero {
        padding: 6rem 0 4rem;
        min-height: calc(100vh - 80px);
    }

    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .badges-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .badge-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .badge-actions .btn {
        min-width: auto;
        width: 100%;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .code-example {
        padding: 1.5rem;
    }
    
    .copy-code-btn {
        position: static;
        margin-top: 1rem;
        width: 100%;
    }
    
    .tab-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .tab-btn {
        width: 100%;
        text-align: center;
    }
    
    .code-snippet {
        padding: 1rem;
    }
    
    .code-snippet pre {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 1rem;
    }

    .hero {
        padding: 6rem 0 4rem;
    }
    
    .why-section,
    .badges-section,
    .how-to-section {
        padding: 4rem 0;
    }
    
    .badge-card,
    .why-card {
        padding: 2rem;
    }
    
    .badge-code {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    .badge-code pre {
        padding: 0.5rem;
    }
    
    .badge-code code {
        font-size: 0.75rem;
    }
    
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
    .hero-content,
    .hero-visual {
        animation: fadeInUp 1s ease-out;
    }
    
    .why-card,
    .badge-card {
        animation: fadeInUp 0.8s ease-out forwards;
        opacity: 0;
        transform: translateY(30px);
    }
    
    .why-card:nth-child(1) { animation-delay: 0.1s; }
    .why-card:nth-child(2) { animation-delay: 0.2s; }
    .why-card:nth-child(3) { animation-delay: 0.3s; }
    
    .badge-card:nth-child(1) { animation-delay: 0.1s; }
    .badge-card:nth-child(2) { animation-delay: 0.2s; }
    .badge-card:nth-child(3) { animation-delay: 0.3s; }
    .badge-card:nth-child(4) { animation-delay: 0.4s; }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Focus states for accessibility */
.btn:focus,
button:focus {
    outline: 2px solid #4299E1;
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border-width: 3px;
    }
    
    .nav-link::after {
        height: 3px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .hero-cta,
    .badge-actions,
    .copy-code-btn {
        display: none;
    }
    
    .hero {
        background: white !important;
        color: black !important;
        min-height: auto;
        padding: 2rem 0;
    }
    
    .hero-title .accent {
        color: #000 !important;
    }
}
