:root {
    --primary: #D4AF37;
    /* Gold */
    --accent: #E6B800;
    --bg: #0F172A;
    --card: #1E293B;
    --text: #F1F5F9;
    --muted: #94A3B8;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font: 'Lexend', sans-serif;
    --transition: 0.3s ease;
}

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

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.screen {
    display: none;
    height: 100vh;
    width: 100vw;
    animation: fadeIn 0.4s ease;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Login */
#login-screen {
    display: none;
    /* Default hidden */
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, #0F172A 0%, #172554 100%);
}

#login-screen.active {
    display: flex;
}

.login-box {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 3rem 2rem;
    border-radius: 2rem;
    text-align: center;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.logo {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    letter-spacing: -1px;
}

.logo span {
    color: var(--primary);
}

.login-box p {
    color: var(--muted);
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

input,
select {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

input:focus,
select:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    border-radius: 1rem;
    background: var(--primary);
    color: var(--bg);
    border: none;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:active {
    transform: scale(0.98);
}

.error {
    color: #FF4D4D;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* App Layout */
.app-header {
    background: var(--card);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

#nav-info {
    display: flex;
    flex-direction: column;
}

#day-number {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary);
}

#day-date {
    font-size: 0.9rem;
    color: var(--muted);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.3rem;
    cursor: pointer;
}

/* Timeline */
.timeline-container {
    background: var(--bg);
    padding: 1.5rem 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--glass-border);
}

.timeline {
    display: flex;
    gap: 1rem;
    padding: 0 1rem;
}

.timeline-item {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    border-radius: 1rem;
    background: var(--card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.timeline-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
    transform: scale(1.1);
}

.timeline-item span:first-child {
    font-size: 0.7rem;
    font-weight: 600;
}

.timeline-item span:last-child {
    font-size: 1.3rem;
    font-weight: 800;
}

/* Day Content */
main {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 80px;
}

.day-hero {
    padding: 2rem 1.5rem;
    background: linear-gradient(180deg, var(--card) 0%, var(--bg) 100%);
}

#day-title {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}

/* Sections */
.info-sections {
    padding: 0 1.5rem;
}

.section {
    margin-bottom: 1.5rem;
    background: var(--card);
    border-radius: 1.5rem;
    padding: 1.2rem;
    border: 1px solid var(--glass-border);
}

.section-header {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header>div {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.add-item-btn {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.add-item-btn:hover {
    background: var(--primary);
    color: var(--bg);
}

.delete-item-btn {
    color: #ef4444;
    font-size: 1rem;
    margin-left: 0.5rem;
    opacity: 0.7;
    transition: var(--transition);
}

.delete-item-btn:hover {
    opacity: 1;
    color: #b91c1c;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.btn-secondary {
    padding: 1rem;
    border-radius: 1rem;
    background: var(--glass);
    color: var(--text);
    border: 1px solid var(--glass-border);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.btn-secondary:active,
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.section-body {
    font-size: 1rem;
    color: var(--text);
    line-height: 1.5;
}

.item-block {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.item-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.item-time {
    display: inline-block;
    background: rgba(212, 175, 55, 0.15);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.item-desc {
    display: inline;
    vertical-align: middle;
}

.item-links {
    margin-top: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.item-link {
    background: var(--glass);
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.item-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

/* AI Suggestions */
.ai-section {
    margin: 1rem 1.5rem 0;
}

.ai-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(230, 184, 0, 0.06) 100%);
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    transition: var(--transition);
}

.ai-btn:hover,
.ai-btn:active {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--primary);
    transform: scale(0.99);
}

.ai-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.ai-result {
    margin-top: 1rem;
    padding: 1.2rem;
    background: var(--card);
    border-radius: 1.2rem;
    border: 1px solid rgba(212, 175, 55, 0.25);
    font-size: 0.92rem;
    line-height: 1.7;
    white-space: pre-wrap;
    color: var(--text);
    animation: fadeIn 0.4s ease;
}

/* Live Discussion Tabs */
.live-section {
    margin: 1rem 1.5rem;
    background: var(--card);
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    color: var(--muted);
    font-weight: 600;
    font-family: inherit;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    background: rgba(255, 255, 255, 0.02);
}

.tab-pane {
    display: none;
    padding: 1rem;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.list-container {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.msg-item {
    margin-bottom: 0.8rem;
}

.msg-meta {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.msg-text {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.8rem 1rem;
    border-radius: 1rem;
    display: inline-block;
    max-width: 100%;
}

.add-form {
    display: flex;
    gap: 0.5rem;
}

.add-form select {
    width: auto;
    padding: 0.8rem;
}

.add-form input {
    flex: 1;
}

.add-form button {
    background: var(--primary);
    border: none;
    color: var(--bg);
    width: 48px;
    border-radius: 1rem;
    font-size: 1.1rem;
}

/* Navigation Footer */
.app-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    display: flex;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 1.5rem 2rem 1.5rem;
    gap: 1rem;
    z-index: 100;
    border-top: 1px solid var(--glass-border);
}

.app-nav button {
    flex: 1;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    background: var(--card);
    color: var(--text);
    font-weight: 600;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.app-nav button:active {
    background: var(--glass);
}