
/* =========================
   Theme variables & Base Layout Styles
   ========================= */
:root {
    /* Dark theme palette */
    --bg: #161616;            /* page background */
    --surface: #202122;       /* section cards */
    --card-bg: #22242b;       /* inner card body */
    --text: #e6eef6;          /* primary text */
    --muted: #9aa6b2;         /* secondary text */
    --muted-border: rgba(255,255,255,0.04);
    --accent: #7c3aed;        /* accent / purple */
    --online: #22c55e;
    --offline: #6b7280;
    --archived: #9c45ff;
    --scroll-thumb: rgba(255,255,255,0.08);

    /* Bootstrap variable bridge for consistency */
    --bs-primary: var(--accent);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-link-color: var(--accent);
    --bs-border-color: var(--muted-border);
}

/* Light theme overrides (toggled via `data-theme="light"` on <html>) */
[data-theme="light"] {
    --bg: #f8fafc;           /* near-white page background */
    --surface: #ffffff;      /* section cards */
    --card-bg: #ffffff;      /* inner card body */
    --text: #0b1220;         /* dark text */
    --muted: #6b7280;        /* muted text */
    --muted-border: rgba(0,0,0,0.06);
    --accent: #6d28d9;
    --online: #16a34a;
    --offline: #9ca3af;
    --archived: #7c3aed;
    --scroll-thumb: rgba(0,0,0,0.12);

    /* Bootstrap bridge in light mode */
    --bs-primary: var(--accent);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-link-color: var(--accent);
    --bs-border-color: var(--muted-border);
}

body {
    background: var(--bg);
    color: var(--text);
    transition: background-color 200ms ease, color 200ms ease;
}

.section {
    background: var(--surface);
    border-radius: 30px;
    box-shadow: 0 4px 18px rgba(2,6,23,0.6);
}

/* =========================
   Carousel Styles
   ========================= */
.carousel-row {
    display: flex;
    gap: 3rem;
    overflow-x: auto;
    /* Custom property for accent shift */
    --accent-shift: 2.5rem;
    /* Padding uses accent shift for consistent spacing */
    padding: 0 calc(var(--accent-shift) + 0.25rem) 0.5rem calc(var(--accent-shift) + 0.25rem);
    scroll-behavior: smooth;
    width: 100%;
    margin-top: var(--accent-shift);
}

/* Carousel scrollbar styling */
.carousel-row::-webkit-scrollbar {
    height: 10px;
}
.carousel-row::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 8px;
}

/* Theme toggle button (fixed in the corner) */
#theme-toggle {
    position: fixed;
    right: 1rem;
    top: 1rem;
    background: rgba(255,255,255,0.04);
    color: var(--text);
    border: 1px solid var(--muted-border);
    padding: 0.5rem 0.6rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 6px 18px rgba(2,6,23,0.5);
    transition: background-color 150ms ease, transform 120ms ease;
}

#theme-toggle:hover { transform: translateY(-2px); }

#theme-toggle:active { transform: translateY(0); }

#theme-toggle .label { font-size: 0.9rem; color: var(--muted); }

/* Ensure toggle looks appropriate on light theme */
[data-theme="light"] #theme-toggle { background: rgba(0,0,0,0.04); box-shadow: 0 6px 18px rgba(2,6,23,0.06); }

/* Card image styling */
.card-image {
    position: absolute;
    left: calc(-2 * var(--accent-shift));
    top: calc(-1 * var(--accent-shift));
    height: calc(100% + var(--accent-shift));
    width: calc(100% + var(--accent-shift) * 2);
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    border-bottom-right-radius: 20px;
    border-bottom-left-radius: 20px;
    z-index: 0;

}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    border-bottom-right-radius: 20px;
    border-bottom-left-radius: 20px;
}

/* =========================
   Carousel Card Styles
   ========================= */
.carousel-card {
    flex: 0 0 260px; /* Fixed card width */
    min-width: 260px;
    min-height: 380px;
    position: relative;
    overflow: visible;
    margin: var(--accent-shift) var(--accent-shift) calc(var(--accent-shift) * 2) var(--accent-shift);
}

.card-body {
    position: relative;
    padding: 1.5rem 1rem;
    background: var(--card-bg);
    color: var(--text);
    width: 100%;
    height: 100%;
    border-radius: 20px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: 0 6px 18px rgba(2,6,23,0.6);
}

.carousel-title {
    margin-top: 1rem;
    margin-left: 1rem;
    
}

/* Status badge styles */
.status-badge {
    position: absolute;
    top: 5px;
    right: 10px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-online {
    background-color: var(--online);
    color: white;
}

.status-offline {
    background-color: var(--offline);
    color: white;
}

.status-archived {
    background-color: var(--archived);
    color: white;
}

/* Server header styles */
.server-header {
    text-align: center;
    margin-top: 0.5rem;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.card-motd {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0;
}

/* Info section styles */
.info-section {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding: 1rem 0;
    margin: 0.5rem 0;
    border-top: 1px solid var(--muted-border);
    border-bottom: 1px solid var(--muted-border);
}

.info-block {
    flex: 1;
    text-align: center;
}

.info-block h6 {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.info-block p {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.divider {
    width: 1px;
    background-color: var(--muted-border);
    margin: 0 1rem;
}

/* Description section styles */
.description-section {
    flex: 1;
    overflow: hidden;
}

.description-section p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
    color: var(--text);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================
   Fullscreen Panel Styles
   ========================= */
.fullscreen-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fullscreen-panel.active {
    display: block;
    opacity: 1;
}

.close-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--surface);
    border: none;
    color: var(--text);
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.2s ease;
}

.close-panel:hover {
    transform: scale(1.1);
}

.panel-content {
    height: 100%;
    overflow-y: auto;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.panel-header {
    position: relative;
    width: 100%;
    height: 300px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.panel-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.panel-status {
    position: absolute;
    top: 20px;
    right: 20px;
}

.panel-body {
    flex: 1;
    padding: 2rem;
    background: var(--surface);
    border-radius: 20px;
}

.panel-motd {
    color: var(--muted);
    font-size: 1.1rem;
    margin: 1rem 0 2rem 0;
}

.panel-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 15px;
}

.panel-info-block {
    text-align: center;
}

.panel-info-block h6 {
    color: var(--muted);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.panel-info-block p {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.panel-description {
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 15px;
}

.panel-description h6 {
    color: var(--muted);
    margin-bottom: 1rem;
}

.panel-description p {
    line-height: 1.6;
    margin: 0;
}

/* Copy IP Button */
.copy-ip-button {
    width: 100%;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.copy-ip-button:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.copy-ip-button:active {
    transform: translateY(0);
}

.copy-ip-button.copied {
    background: var(--online);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.copy-ip-button svg {
    flex-shrink: 0;
}

/* Make carousel cards clickable */
.carousel-card {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.carousel-card:hover {
    transform: translateY(-5px);
}

/* =========================
   Modpack Section Styles
   ========================= */
.panel-body-with-mod {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: flex-start;
    width: 100%;
}

.modpack-section {
    flex-shrink: 0;
    width: 300px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 4px 18px rgba(2,6,23,0.3);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modpack-icon {
    width: 120px;
    height: 120px;
    background: var(--surface);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(2,6,23,0.15);
    overflow: hidden;
}

.modpack-details {
    width: 100%;
}

.modpack-details h4 {
    margin-bottom: 1rem;
    color: var(--accent);
    font-size: 1.4rem;
    text-align: center;
}

.modpack-details p {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    text-align: center;
    line-height: 1.5;
}

.modpack-link {
    padding-top: 5rem;
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent);
    border-radius: 8px;
    transition: all 0.2s ease;
    width: 100%;
}

.modpack-link:hover {
    background: var(--accent);
    color: white;
}

@media (max-width: 900px) {
    .panel-body-with-mod {
        flex-direction: column;
        gap: 1rem;
    }
    .modpack-section {
        margin-left: 0;
        margin-top: 1rem;
        width: 100%;
        max-width: none;
    }
}

/* =========================
   Responsive Styles
   ========================= */
@media (max-width: 100%) {
    .carousel-card {
        flex: 0 0 100%;
    }
    .section,
    .carousel-row {
        width: 95%; /* Wider on mobile for better usability */
    }
    
    .panel-body {
        padding: 1rem;
    }
    
    .panel-header {
        height: 200px;
    }
    
    .panel-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Basic link and button alignment with accent */
a { color: var(--accent); }
a:hover { color: #6d28d9; }

.btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover { background-color: #6d28d9; border-color: #6d28d9; }

.link-light { color: var(--muted); }
.link-light:hover { color: var(--text); }
