:root {
    --primary-gradient: linear-gradient(135deg, #4776E6 0%, #8E54E9 100%);
    --secondary-gradient: linear-gradient(135deg, #FF6B6B 0%, #FFE66D 100%);
    --ai-gradient: linear-gradient(135deg, #43cea2 0%, #185a9d 100%);
    --user-gradient: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
    --accent-color: #6c5ce7;
    --error-color: #ff6b6b;
    --success-color: #1dd1a1;
    --text-color: #2d3436;
    --bg-color: #f9f9f9;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --input-bg: #f5f5f5;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --glow: 0 0 20px rgba(135, 108, 231, 0.3);
}

.dark-mode {
    --primary-gradient: linear-gradient(135deg, #4776E6 0%, #8E54E9 100%);
    --secondary-gradient: linear-gradient(135deg, #FF6B6B 0%, #FFE66D 100%);
    --ai-gradient: linear-gradient(135deg, #43cea2 0%, #185a9d 100%);
    --user-gradient: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
    --text-color: #f9f9f9;
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --border-color: #2a2a4a;
    --input-bg: #1e2a4a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --glow: 0 0 20px rgba(135, 108, 231, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s, transform 0.3s, box-shadow 0.3s;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 25px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    animation: float 6s ease-in-out infinite;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
}

.logo i {
    font-size: 2.2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.theme-toggle {
    background: var(--primary-gradient);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.5rem;
    color: white;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(30deg);
    box-shadow: var(--glow);
}

.welcome-message {
    text-align: center;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.welcome-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--primary-gradient);
}

.welcome-message h2 {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 15px;
    font-size: 2rem;
}

.welcome-message p {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 1.1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.test-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.primary-btn, .secondary-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
}

.primary-btn {
    background: var(--primary-gradient);
}

.secondary-btn {
    background: var(--secondary-gradient);
}

.primary-btn::before, .secondary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.primary-btn:hover, .secondary-btn:hover {
    transform: translateY(-5px);
    box-shadow: var(--glow);
}

.primary-btn:hover::before, .secondary-btn:hover::before {
    opacity: 1;
}

.main-content {
    display: flex;
    gap: 30px;
    flex-grow: 1;
}

.test-series-panel {
    flex: 0 0 300px;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
    height: fit-content;
}

.test-series-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--secondary-gradient);
}

.test-series-panel h2 {
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 15px;
    font-size: 1.5rem;
    text-align: center;
}

.test-category {
    margin-bottom: 20px;
}

.test-category h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.test-category h3 i {
    font-size: 1.2rem;
}

.test-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.test-btn {
    background: var(--card-bg);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 15px;
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
}

.test-btn:hover {
    transform: translateX(5px);
    box-shadow: var(--glow);
    border-color: var(--accent-color);
}

.test-btn:hover i {
    transform: translateX(5px);
}

.test-btn i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.date-search-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#dateSearch {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

#dateSearch:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: var(--glow);
}

.search-btn {
    padding: 12px 15px;
    border: none;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: white;
    cursor: pointer;
    font-weight: 600;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.search-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--glow);
}

.chat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    min-height: 500px;
}

.chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--ai-gradient);
}

.chat-header {
    padding: 20px;
    background: var(--ai-gradient);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header h2 i {
    animation: pulse 2s infinite;
}

.chat-history-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.chat-history-btn:hover {
    transform: rotate(15deg);
    background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
    flex-grow: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(135, 108, 231, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 107, 107, 0.05) 0%, transparent 20%);
}

.message {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 20px;
    line-height: 1.5;
    position: relative;
    animation: fadeIn 0.5s ease;
    box-shadow: var(--shadow);
}

.user-message {
    align-self: flex-end;
    background: var(--user-gradient);
    color: white;
    border-bottom-right-radius: 5px;
}

.ai-message {
    align-self: flex-start;
    background: var(--ai-gradient);
    color: white;
    border-bottom-left-radius: 5px;
}

.message-time {
    font-size: 0.75rem;
    margin-top: 8px;
    text-align: right;
    opacity: 0.8;
}

.chat-input {
    display: flex;
    padding: 20px;
    border-top: 2px solid var(--border-color);
    background: var(--card-bg);
    position: relative;
}

.chat-input input {
    flex-grow: 1;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: var(--glow);
}

.send-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    margin-left: 15px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--glow);
}

footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-color);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }
    
    .test-series-panel {
        flex: 1;
    }
    
    .container {
        padding: 15px;
    }
    
    .welcome-message h2 {
        font-size: 1.6rem;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    .test-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .primary-btn, .secondary-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .chat-header h2 {
        font-size: 1.2rem;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .theme-toggle {
        position: absolute;
        top: 15px;
        right: 15px;
    }
}