:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f3f4f6;
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: rgba(255, 255, 255, 0.3);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #e0e7ff 0%, #f3f4f6 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

.container {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 72px;
    gap: 16px;
}

.logo {
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #818cf8, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.nav a,
.welcome,
.link-button {
    color: #e5e7eb;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav a:hover {
    color: #fff;
    transform: translateY(-1px);
}

.link-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.link-button:hover {
    color: #fff;
}

.page {
    padding: 40px 0 60px;
}

.hero,
.card,
.form-card,
.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero {
    padding: 40px;
    margin-bottom: 32px;
    text-align: center;
    background: linear-gradient(to right bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.5));
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: #111827;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.hero h1,
.page-header h1,
.form-card h1,
.thread-detail h1 {
    margin-top: 0;
}

.grid.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.card {
    padding: 30px;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.form-card {
    max-width: 600px;
    padding: 40px;
    margin: 0 auto;
}

.form-card.wide {
    max-width: 900px;
}

.form {
    display: grid;
    gap: 20px;
}

.form label {
    display: grid;
    gap: 10px;
    font-weight: 600;
    color: #374151;
}

.form input,
.form textarea {
    width: 100%;
    border: 2px solid rgba(209, 213, 219, 0.5);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form input:focus,
.form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.primary-button,
.secondary-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.primary-button {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.primary-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    color: #fff;
}

.secondary-button {
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
    border: 1px solid rgba(209, 213, 219, 0.8);
}

.secondary-button:hover {
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    color: #111827;
}

.danger-button {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.danger-button:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.page-header,
.section-title,
.board-item,
.thread-item,
.reply-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.page-header {
    margin-bottom: 24px;
}

.section-title {
    margin-bottom: 24px;
    border-bottom: 2px solid rgba(229, 231, 235, 0.5);
    padding-bottom: 12px;
}

.section-title h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #111827;
}

.board-list,
.thread-list,
.reply-list {
    display: grid;
    gap: 16px;
}

.board-item,
.thread-item,
.reply-item,
.admin-row {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.board-item:hover,
.thread-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.9);
}

.thread-item h2,
.thread-item h3,
.board-item h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
}

.compact .thread-item h3 {
    margin-bottom: 6px;
    font-size: 1.1rem;
}

.thread-stats,
.thread-meta,
.subtle,
.meta {
    color: var(--text-muted);
    font-size: 14px;
}

.thread-stats,
.thread-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.thread-content,
.reply-content,
.excerpt {
    line-height: 1.8;
    font-size: 1.05rem;
    color: #374151;
}

.reply-item {
    background: rgba(249, 250, 251, 0.7);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 700;
}

.alert {
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(8px);
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(220, 252, 231, 0.8);
    color: #166534;
    border-color: rgba(134, 239, 172, 0.5);
}

.alert-error {
    background: rgba(254, 226, 226, 0.8);
    color: #991b1b;
    border-color: rgba(252, 165, 165, 0.5);
}

.empty-text {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

.centered {
    text-align: center;
}

.admin-actions,
.row-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 24px;
    text-align: center;
}

.stat-label {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary-color);
    margin-top: 8px;
}

.admin-layout {
    align-items: start;
}

.board-admin-form {
    margin: 0;
    max-width: none;
}

.admin-table {
    display: grid;
    gap: 16px;
}

.admin-row h2,
.admin-row h3 {
    margin: 0 0 8px;
}

/* Carousel Styles */
.install-layout {
    align-items: start;
}

.install-form-card {
    margin: 0;
}

.install-section {
    display: grid;
    gap: 16px;
    padding-top: 8px;
}

.install-section h3,
.install-code-block h3 {
    margin: 0;
}

.install-checklist {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.install-checklist p {
    margin: 0;
    line-height: 1.7;
}

.install-code-block {
    padding: 16px;
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.8);
    margin-bottom: 14px;
}

.install-code-block pre {
    margin: 12px 0 0;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.install-success {
    display: grid;
    gap: 16px;
}

.install-steps .stat-value.small {
    font-size: 22px;
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
    transform: scale(1.05);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    background-size: cover;
    background-position: center;
}

.carousel-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}

.carousel-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    padding: 0 20px;
}

.carousel-content h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s ease 0.3s;
}

.carousel-slide.active .carousel-content h2 {
    transform: translateY(0);
    opacity: 1;
}

.carousel-content p {
    font-size: 1.2rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s ease 0.5s;
}

.carousel-slide.active .carousel-content p {
    transform: translateY(0);
    opacity: 1;
}

.carousel-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 12px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: #fff;
    transform: scale(1.2);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.carousel-btn.prev { left: 20px; }
.carousel-btn.next { right: 20px; }

@media (max-width: 768px) {
    .grid.two-column {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .header-inner,
    .page-header,
    .section-title,
    .board-item,
    .thread-item,
    .reply-head,
    .admin-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .thread-stats,
    .row-actions,
    .admin-actions {
        align-items: flex-start;
    }
    
    .carousel-container {
        height: 300px;
    }
    
    .carousel-content h2 {
        font-size: 2rem;
    }
}
