body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Background effects */
.page-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    filter: blur(100px);
    pointer-events: none;
}

.app-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.container {
    flex: 1;
    overflow-y: auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-content-wrapper {
    width: 100%;
    max-width: 800px;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s ease;
}

.sidebar.hidden {
    margin-left: -280px;
}

.sidebar-toggle {
    position: absolute;
    top: 50%;
    left: 280px;
    transform: translateY(-50%);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: none;
    color: var(--text-primary);
    width: 24px;
    height: 48px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.3s ease, background 0.2s;
    z-index: 100;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar.hidden + .sidebar-toggle {
    left: 0;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: var(--text-primary);
}

.sidebar-brand span {
    color: var(--primary);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px 10px;
}

.history-item {
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.2s;
    position: relative;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.history-item.active {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.history-item-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.history-item-content {
    flex: 1;
    min-width: 0;
}

.history-item-text {
    font-size: 0.9rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.history-item-date {
    font-size: 0.7rem;
    color: var(--text-sec);
    opacity: 0.5;
}

.btn-delete-history {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-sec);
    opacity: 0;
    cursor: pointer;
    transition: all 0.2s;
    padding: 5px;
}

.history-item:hover .btn-delete-history {
    opacity: 0.6;
}

.btn-delete-history:hover {
    opacity: 1 !important;
    color: var(--error);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-sec);
    line-height: 1.4;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.footer {
    text-align: center;
    color: var(--text-sec);
    font-size: 0.85rem;
    margin-top: 40px;
    margin-bottom: 40px;
    opacity: 0.7;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.3s ease;
}

body.light-theme .brand-title {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-sec) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.subtitle {
    color: var(--text-sec);
    margin-top: 8px;
    font-size: 1.1rem;
}

/* AI Model Selector Styling */
.model-selector-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.model-badge {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 8px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-sec);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.model-badge:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.15);
}

.model-badge .pulse {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse 2s infinite;
}

.model-dropdown {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-family: var(--font-main);
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    padding-right: 5px;
    transition: color 0.2s;
}

.model-dropdown:hover {
    color: var(--primary-hover);
}

.model-dropdown option {
    background: var(--bg-color);
    color: var(--text-primary);
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
