/* Optimized Design System - v2.0 */
:root {
    /* Brand Colors */
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --accent: #0ea5e9;
    
    /* Semantic */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Dark Mode (Default) */
    --text-1: #f1f5f9;
    --text-2: #cbd5e1;
    --text-3: #94a3b8;
    --bg-1: #0f172a;
    --bg-2: #1e293b;
    --bg-3: #334155;
    --bg-accent: rgba(37, 99, 235, 0.1);
    --border: #334155;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    
    /* Layout */
    --radius: 12px;
    --max-w: 1200px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 0.3s ease-out;
}

/* Light Mode */
@media (prefers-color-scheme: light) {
    :root {
        --text-1: #1e293b;
        --text-2: #475569;
        --text-3: #64748b;
        --bg-1: #eff6ff;
        --bg-2: #dbeafe;
        --bg-3: #bfdbfe;
        --bg-accent: rgba(37, 99, 235, 0.08);
        --border: #93c5fd;
        --shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
        --shadow-lg: 0 10px 25px rgba(37, 99, 235, 0.15);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    line-height: 1.6;
    color: var(--text-1);
    background: var(--bg-1);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.15s ease-out;
}
.skip-link:focus { top: 6px; }

/* Focus Visible */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Header */
.header {
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.nav-container {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
.nav-brand:hover, .nav-brand:focus-visible { color: var(--primary-light); }

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1rem;
}

.nav-menu a {
    color: var(--text-2);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    position: relative;
    display: block;
}

.nav-menu a:hover, .nav-menu a:focus-visible, .nav-menu a.active {
    color: var(--primary);
    background: var(--bg-accent);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transform: translateX(-50%);
    transition: width var(--transition);
}

.nav-menu a:hover::after, .nav-menu a:focus-visible::after, .nav-menu a.active::after {
    width: calc(100% - 2rem);
}

/* Hamburger Menu */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    flex-direction: column;
    gap: 4px;
    width: 44px;
    height: 44px;
    justify-content: center;
    align-items: center;
    transition: transform var(--transition);
}

.nav-toggle:hover, .nav-toggle:focus-visible {
    background: var(--bg-accent);
    transform: scale(1.1);
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-1);
    transition: all var(--transition);
    border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

/* Main Content */
.main { min-height: calc(100vh - 200px); }
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-1);
    line-height: 1.2;
    text-align: center;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); margin-bottom: 1.5rem; }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); margin-bottom: 1rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.75rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-2);
    text-align: center;
    max-width: 70ch;
    margin-left: auto;
    margin-right: auto;
}

.lead {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    text-align: center;
    max-width: 70ch;
    margin: 0 auto 2rem;
    color: var(--text-2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1rem;
    line-height: 1;
    min-height: 44px;
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease-out;
}

.btn:hover::before { left: 100%; }
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover:not(:disabled), .btn-primary:focus-visible {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: var(--bg-3);
    color: var(--text-1);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled), .btn-secondary:focus-visible {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled), .btn-success:focus-visible {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    min-height: 52px;
}

/* Loading State */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
    color: white;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 6rem 1rem 4rem;
    background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg-1) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23f1f5f9' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero h1, .hero p { position: relative; }
.hero p { margin: 0 auto 1rem; }

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
    position: relative;
}

/* Card System */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 2rem;
    margin: 2rem 0;
    justify-items: center;
}

.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 1600px;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: var(--radius) var(--radius) 0 0;
    opacity: 0;
    transition: opacity var(--transition);
}

.card:hover::before, .card:focus-within::before { opacity: 1; }
.card:hover, .card:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.card p, .card ul { text-align: left; }

/* Minecraft Specific */
.server-main {
    border: 2px solid var(--primary);
    background: var(--bg-2);
    max-width: 100%;
}

.server-connect { text-align: center; margin-bottom: 2rem; }
.server-ip-section { margin-bottom: 2rem; }

.ip-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.ip-display code {
    background: var(--bg-3);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    border: 2px solid var(--primary);
    font-family: 'Courier New', monospace;
}

.server-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    text-align: center;
    margin:auto;
}

.server-details {
    text-align: center;
    padding: 1rem;
    font-size: 1.5rem;
}

.server-details strong {
    color: var(--text-1);
    font-size: 1rem;
}

.server-details code {
    font-size: 1.5rem;
}

.detail-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-accent);
    border-radius: var(--radius);
}

/* Focus Grid */
.focus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.focus-grid article { text-align: center; }

/* Contact Methods */
.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-1);
    transition: all var(--transition);
    text-align: center;
}

.contact-link:hover, .contact-link:focus-visible {
    background: var(--bg-3);
    transform: translateY(-2px);
}

.contact-link strong { color: var(--primary); }
.contact-link span {
    color: var(--text-2);
    font-size: 0.875rem;
}

/* Topic Tags */
.topics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
}

.topic-tag {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Rules */
.rules-card { border: 2px solid var(--warning); margin: auto; width: 100%;}
.rules-simple { text-align: center; }

.rule-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    justify-items: center;
}

.rule-item {
    padding: 1.5rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
}

.rule-item.allowed {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
}

.rule-item.forbidden {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
}

.rule-item h4 {
    text-align: center;
    margin-bottom: 1rem;
}

.rule-item.allowed h4 { color: var(--success); }
.rule-item.forbidden h4 { color: var(--danger); }

.rule-item ul {
    list-style: none;
    padding: 0;
    text-align: left;
}

.rule-item li {
    padding: 0.5rem 0 0.5rem 1.5rem;
    position: relative;
}

.rule-item.allowed li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}

.rule-item.forbidden li::before {
    content: '✗';
    position: absolute;
    left: 0;
    color: var(--danger);
    font-weight: 700;
}

.rule-note {
    margin-top: 1rem;
    font-weight: 500;
    text-align: center;
    color: var(--danger);
}

/* Mod Cards */
.mod-card { border-left: 4px solid var(--accent); }

/* Contact Links */
.contact-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

/* Support Info */
.support-info {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.support-info h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.support-info p { text-align: left; }

/* Server Status */
.server-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-accent);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: var(--danger);
    animation: none;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--success); }
    70% { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* Feature List */
.feature-list {
    list-style: none;
    padding: 0;
    text-align: center;
    margin: auto;
}

.feature-list li {
    padding: 0.75rem 0 0.75rem 2rem;
    position: relative;
    transition: padding-left var(--transition);
}

.feature-list li:hover { padding-left: 2.5rem; }

.feature-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2em;
    transition: transform var(--transition);
}

.feature-list li:hover::before { transform: translateX(0.25rem); }

/* Slideshow */
.slideshow-container {
    position: relative;
    max-width: 100%;
    margin: 2rem 0;
}

.slideshow {
    position: relative;
    height: 300px;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-3);
    box-shadow: var(--shadow);
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.slide.active { opacity: 1; }

.slide-content {
    text-align: center;
    color: white;
    padding: 2rem;
    max-width: 80%;
}

.slide-content h4 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    margin-bottom: 1rem;
    color: white;
}

.slide-content p {
    font-size: clamp(0.875rem, 2vw, 1.125rem);
    color: rgba(255, 255, 255, 0.9);
}

.slideshow-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    gap: 1rem;
}

.slide-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.25rem;
    transition: all var(--transition);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-btn:hover, .slide-btn:focus-visible {
    background: var(--accent);
    transform: scale(1.1);
}

.slide-indicators {
    display: flex;
    gap: 0.75rem;
    flex: 1;
    justify-content: center;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.indicator::after {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    transition: background var(--transition);
}

.indicator.active::after, .indicator:hover::after, .indicator:focus-visible::after {
    background: var(--primary);
}

/* Breadcrumb */
.breadcrumb-nav {
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
}

.breadcrumb {
    display: flex;
    list-style: none;
    gap: 1rem;
    align-items: center;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 1rem;
    color: var(--text-3);
}

.breadcrumb a {
    color: var(--text-2);
    text-decoration: none;
    transition: color var(--transition);
}

.breadcrumb a:hover, .breadcrumb a:focus-visible { color: var(--primary); }
.breadcrumb li[aria-current="page"] {
    color: var(--text-1);
    font-weight: 500;
}

/* Footer */
.footer {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer-content {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-2);
    text-decoration: none;
    transition: all var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    position: relative;
}

.footer-links a:hover, .footer-links a:focus-visible {
    color: var(--primary);
    background: var(--bg-accent);
}

.footer-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.footer-info p {
    color: var(--text-3);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Discord Widget Container */
.discord-widget-container {
    flex: 0 0 auto;
    min-width: 200px;
}

/* Mobile */
@media (max-width: 768px) {
    .nav-container { justify-content: space-between; }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-2);
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow-lg);
        transform: translateX(-100%);
        transition: transform var(--transition);
        gap: 1rem;
        border-top: 1px solid var(--border);
    }
    
    .nav-menu.active { transform: translateX(0); }
    .nav-toggle { display: flex; }
    .card-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .hero { padding: 4rem 1rem 3rem; }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .slideshow-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .slide-indicators {
        order: -1;
        margin-bottom: 1rem;
    }
    
    .ip-display { flex-direction: column; gap: 0.5rem; }
    .server-details-grid { grid-template-columns: 1fr; }
    .rule-list { grid-template-columns: 1fr; }
    .focus-grid { grid-template-columns: 1fr; }
    .contact-methods { gap: 0.5rem; }
}

/* Utilities */
.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;
}

.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }