:root {
    --text-primary: #e0f2f1;
    --text-secondary: #b2dfdb;
    --glass-bg: rgba(13, 40, 48, 0.55);
    --glass-border: rgba(128, 203, 196, 0.2);
    --accent-color: #4db6ac;
    --hover-bg: rgba(77, 182, 172, 0.2);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Noto Serif SC', serif;
    color: var(--text-primary);
    overflow: hidden; /* Hide scrollbars on body, we'll scroll specific elements */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.8) blur(0px); /* I will leave blur at 0 since the image itself is really good, maybe subtle dark tint */
    z-index: -2;
    transform: scale(1.05); /* hide edges if we animate */
}

/* Subtle Rain Animation Effect Container */
.rain-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.drop {
    position: absolute;
    bottom: 100%;
    width: 1px;
    height: 30px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.4));
    animation: rain linear infinite;
}

@keyframes rain {
    0% { transform: translateY(0); }
    100% { transform: translateY(110vh); }
}

.app-container {
    display: flex;
    width: 90%;
    max-width: 1300px;
    height: 85vh;
    gap: 20px;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

/* Sidebar */
.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
}

.logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo h1 {
    font-family: 'Zhi Mang Xing', cursive;
    font-size: 3.5rem;
    color: #a7ffeb;
    text-shadow: 0 0 15px rgba(167, 255, 235, 0.6);
    font-weight: normal;
    letter-spacing: 3px;
    margin-bottom: -5px;
}

.logo p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 5px;
    font-style: italic;
    opacity: 0.8;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.nav-links li:hover {
    background: var(--hover-bg);
    color: #fff;
    transform: translateX(8px);
}

.nav-links li.active {
    background: rgba(77, 182, 172, 0.4);
    color: #fff;
    border-left: 4px solid var(--accent-color);
    transform: translateX(5px);
}

/* Music Player Mini Interface */
.music-player {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    margin-top: auto;
    border: 1px solid rgba(255,255,255,0.05);
}

.vinyl {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: repeating-radial-gradient(#222, #222 2px, #333 3px, #333 4px);
    border: 2px solid #111;
    animation: spin 6s linear infinite;
    position: relative;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}
.vinyl::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #00bcd4;
    border-radius: 50%;
    border: 1px solid #fff;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.track-info {
    display: flex;
    flex-direction: column;
}

.track-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.track-info strong {
    font-size: 0.95rem;
    font-family: 'Noto Serif SC', serif;
    letter-spacing: 1px;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    border-bottom: 1px solid var(--glass-border);
    background: linear-gradient(to bottom, rgba(255,255,255,0.05), transparent);
}

.main-header h2 {
    font-weight: 400;
    font-size: 1.6rem;
    color: #fff;
    letter-spacing: 1px;
}

.actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.btn {
    padding: 10px 22px;
    border: none;
    border-radius: 25px;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
}

.btn-primary {
    background: rgba(77, 182, 172, 0.8);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-primary:hover {
    background: #26a69a;
    box-shadow: 0 0 15px rgba(77, 182, 172, 0.6);
    transform: translateY(-2px);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.2);
    padding: 5px 15px 5px 5px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.1);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
}

.user-profile span {
    font-size: 0.9rem;
}

.thread-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Custom Scrollbar */
.thread-list::-webkit-scrollbar {
    width: 6px;
}

.thread-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

.thread-list::-webkit-scrollbar-thumb {
    background: rgba(77, 182, 172, 0.5);
    border-radius: 10px;
}

.thread-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 20px 25px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.6s ease forwards;
}

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

.thread-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(77, 182, 172, 0.6);
}

.thread-content {
    flex-grow: 1;
}

.thread-title {
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: #e0f7fa;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 400;
}

.tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(77, 182, 172, 0.2);
    color: #a7ffeb;
    border: 1px solid rgba(77, 182, 172, 0.4);
    font-family: sans-serif;
}

.thread-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    gap: 20px;
    font-family: sans-serif;
}

.thread-meta i {
    margin-right: 5px;
    opacity: 0.7;
}

.thread-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: sans-serif;
}

.thread-stats span {
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 12px;
    border-radius: 12px;
    min-width: 65px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}

/* Responsive constraints */
@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
        height: 100vh;
        width: 100%;
        border-radius: 0;
    }
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        padding: 10px 20px;
        border-bottom: 1px solid var(--glass-border);
    }
    .logo {
        margin-bottom: 0;
        margin-right: 20px;
    }
    .logo h1 { font-size: 2rem; }
    .logo p { display: none; }
    .nav-links {
        display: flex;
        gap: 10px;
        overflow-x: auto;
    }
    .nav-links li { padding: 10px; margin-bottom: 0; font-size: 1rem; }
    .music-player { display: none; }
    .main-header { padding: 15px; flex-direction: column; gap: 15px; align-items: flex-start; }
    .thread-item { flex-direction: column; align-items: flex-start; gap: 15px; }
    .thread-stats { flex-direction: row; align-items: center; width: 100%; justify-content: flex-start; }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 30px;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

.modal-header h3 {
    font-weight: 400;
    font-size: 1.4rem;
    color: #fff;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #fff;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-control option {
    background: #0d2830;
    color: #fff;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
}
