/* CachyOS Mirror Fancyindex Theme - Terminal Design */
/* Based on Nginx-Fancyindex-Theme, customized for CachyOS */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    /* Colors */
    --bg-primary: #0a0e14;
    --bg-secondary: rgba(255, 255, 255, 0.02);
    --bg-hover: rgba(0, 255, 65, 0.05);
    --border-primary: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(0, 255, 65, 0.3);
    
    /* Matrix Green */
    --color-primary: #00ff41;
    --color-primary-dim: rgba(0, 255, 65, 0.6);
    --color-primary-glow: rgba(0, 255, 65, 0.3);
    
    /* Accent Colors */
    --color-blue: #00a2ff;
    --color-orange: #ffaa00;
    --color-red: #ff0000;
    
    /* Text */
    --text-primary: #e6e6e6;
    --text-secondary: #888;
    --text-dim: #666;
    
    /* Status Colors */
    --status-operational: #00ff41;
    --status-degraded: #ffaa00;
    --status-outage: #ff0000;
    --status-scheduled: #00a2ff;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glow-primary: 0 0 20px rgba(0, 255, 65, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(0, 255, 65, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 162, 255, 0.03) 0%, transparent 50%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.page-wrapper {
    max-width: 1600px;
    margin: 0 auto;
}

/* ==================== HEADER ==================== */
.site-header {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid var(--border-accent);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.header-content {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: var(--glow-primary);
    margin: 0;
}

.logo-text .subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    color: var(--color-primary);
    border-color: var(--border-accent);
    background: var(--bg-hover);
    box-shadow: var(--glow-primary);
}

/* ==================== BREADCRUMB BAR ==================== */
.breadcrumb-bar {
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid var(--border-primary);
    padding: 0.75rem 2rem;
    font-family: 'JetBrains Mono', monospace;
}

.breadcrumb-content {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prompt {
    color: var(--color-primary);
    font-weight: 600;
}

.separator {
    color: var(--text-dim);
}

.path {
    color: var(--color-blue);
    font-weight: 500;
}

.prompt-symbol {
    color: var(--text-secondary);
    margin-left: 0.25rem;
}

/* ==================== MAIN CONTENT ==================== */
.content-wrapper {
    padding: 2rem;
    min-height: 60vh;
}

/* ==================== FANCYINDEX TABLE ==================== */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
}

thead {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid var(--border-accent);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

tbody tr {
    border-bottom: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

tbody tr:hover {
    background: var(--bg-hover);
    border-left: 3px solid var(--color-primary);
}

td {
    padding: 1rem;
    font-size: 0.875rem;
}

td a {
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

td a:hover {
    color: var(--color-primary);
    text-shadow: var(--glow-primary);
}

/* File icons */
td a::before {
    content: '📄';
    font-size: 1.2rem;
}

td a[href$="/"]::before {
    content: '📁';
}

td a[href$=".zip"]::before,
td a[href$=".tar"]::before,
td a[href$=".gz"]::before,
td a[href$=".xz"]::before {
    content: '📦';
}

td a[href$=".pkg.tar.zst"]::before {
    content: '📦';
}

td a[href$=".iso"]::before {
    content: '💿';
}

/* ==================== STATUS SECTION ==================== */
.status-section {
    padding: 3rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 2px solid var(--border-accent);
    margin-top: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.75rem;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: var(--glow-primary);
}

.refresh-btn {
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid var(--border-accent);
    color: var(--color-primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: var(--glow-primary);
}

.refresh-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
}

.status-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.status-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-primary);
}

.service-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-icon.hetzner {
    background: linear-gradient(135deg, #d50c2d 0%, #ff1744 100%);
}

.service-icon.denic {
    background: linear-gradient(135deg, #0066cc 0%, #00a2ff 100%);
}

.service-icon.monitoring {
    background: linear-gradient(135deg, #00ff41 0%, #00a2ff 100%);
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-content {
    min-height: 100px;
}

.loading,
.error,
.all-clear {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.all-clear {
    color: var(--status-operational);
}

.error {
    color: var(--status-outage);
}

.incident-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--border-accent);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.incident-item:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateX(4px);
}

.incident-item.in_progress {
    border-left-color: var(--status-degraded);
}

.incident-item.identified {
    border-left-color: var(--status-outage);
}

.incident-item.scheduled {
    border-left-color: var(--status-scheduled);
}

.incident-item.resolved {
    border-left-color: var(--status-operational);
}

.incident-status {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    display: inline-block;
}

.incident-status.in_progress {
    background: rgba(255, 170, 0, 0.15);
    color: var(--status-degraded);
}

.incident-status.identified {
    background: rgba(255, 0, 0, 0.15);
    color: var(--status-outage);
}

.incident-status.scheduled {
    background: rgba(0, 162, 255, 0.15);
    color: var(--status-scheduled);
}

.incident-status.resolved {
    background: rgba(0, 255, 65, 0.15);
    color: var(--status-operational);
}

.incident-title {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.affected-systems {
    font-size: 0.75rem;
    color: var(--color-blue);
    margin-top: 0.5rem;
}

.incident-date {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
    font-style: italic;
}

.monitoring-info {
    padding: 1rem 0;
}

.monitoring-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.monitoring-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border-left: 3px solid var(--border-accent);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.stat-value.online {
    color: var(--status-operational);
}

.external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-blue);
    text-decoration: none;
    font-size: 0.75rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.external-link:hover {
    color: var(--color-primary);
    gap: 0.75rem;
}

/* ==================== FOOTER ==================== */
.site-footer {
    background: rgba(0, 0, 0, 0.4);
    border-top: 2px solid var(--border-accent);
    padding: 2rem;
    margin-top: 3rem;
}

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

.footer-section h4 {
    color: var(--color-primary);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--color-blue);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.footer-section a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-primary);
    color: var(--text-dim);
    font-size: 0.75rem;
}

.footer-bottom a {
    color: var(--color-blue);
    text-decoration: none;
}

.footer-bottom a:hover {
    color: var(--color-primary);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .status-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .main-nav {
        width: 100%;
        flex-direction: column;
    }

    .nav-link {
        width: 100%;
        justify-content: center;
    }

    .content-wrapper,
    .status-section {
        padding: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

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

    table {
        font-size: 0.75rem;
    }

    th, td {
        padding: 0.5rem;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

table tbody tr {
    animation: fadeIn 0.3s ease-out;
}

table tbody tr:nth-child(odd) {
    animation-delay: 0.05s;
}

table tbody tr:nth-child(even) {
    animation-delay: 0.1s;
}

/* ==================== MARKDOWN CONTENT ==================== */
#raw_include_HEADER_md,
#raw_include_README_md {
    padding: 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    margin-bottom: 2rem;
}

#raw_include_HEADER_md h1,
#raw_include_HEADER_md h2,
#raw_include_README_md h1,
#raw_include_README_md h2 {
    color: var(--color-primary);
    margin-bottom: 1rem;
}

#raw_include_HEADER_md p,
#raw_include_README_md p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

#raw_include_HEADER_md a,
#raw_include_README_md a {
    color: var(--color-blue);
    text-decoration: none;
}

#raw_include_HEADER_md a:hover,
#raw_include_README_md a:hover {
    color: var(--color-primary);
}

#raw_include_HEADER_md code,
#raw_include_README_md code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    color: var(--color-primary);
    font-family: 'JetBrains Mono', monospace;
}

#raw_include_HEADER_md pre,
#raw_include_README_md pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    border-left: 3px solid var(--border-accent);
}

#raw_include_HEADER_md pre code,
#raw_include_README_md pre code {
    background: none;
    padding: 0;
}
