/* CSS Variables for Theme Management */
:root {
    /* Dark Theme (Default) */
    --bg-primary: #0a0e13;
    --bg-secondary: #0C1922;
    --bg-tertiary: #1a2332;
    --text-primary: #ffffff;
    --text-secondary: #b8c5d1;
    --text-muted: #7a8b99;
    --accent-primary: #0e2124;
    --accent-secondary: #7c3aed;
    --accent-highlight: #fbbf24;
    --border-color: #2d3748;
    --shadow: rgba(0, 0, 0, 0.3);
    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    --gradient-secondary: linear-gradient(135deg, #1a2332 0%, #0C1922 100%);
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
}

[data-theme="light"] {
    /* Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --accent-primary: #3182ce;
    --accent-secondary: #805ad5;
    --accent-highlight: #d69e2e;
    --border-color: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, #3182ce 0%, #805ad5 100%);
    --gradient-secondary: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --danger: #dc2626;
    --success: #059669;
    --warning: #d97706;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo .logo {
    height: 40px;
    width: auto;
    max-width: 40px;
    border-radius: 8px;
    object-fit: contain;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--accent-primary);
}

.nav-user {
    color: var(--accent-primary);
    font-weight: 600;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: 20px;
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.1);
}

/* Main Content */
.main-content {
    min-height: 100vh;
}

.main-content.with-nav {
    padding-top: 70px;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-secondary);
    padding: 20px;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px var(--shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo-img {
    height: 80px;
    width: auto;
    border-radius: 10px;
    margin-bottom: 20px;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.auth-footer {
    text-align: center;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.125rem;
}

/* Dashboard */
.dashboard-container {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

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

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.dashboard-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.agent-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.agent-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px var(--shadow);
    border-color: var(--accent-primary);
}

.agent-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.agent-image {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.agent-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.agent-model {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.agent-notes {
    color: var(--text-secondary);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.agent-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.status-indicator.disabled {
    background: var(--text-muted);
}

.agent-actions {
    display: flex;
    gap: 10px;
}

/* Chat Interface */
.chat-container {
    display: flex;
    height: calc(100vh - 70px);
}

.chat-sidebar {
    width: 300px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-primary);
}

.message {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.message-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 15px;
    max-width: 70%;
}

.message.user .message-content {
    background: var(--accent-primary);
    color: white;
}

.chat-input {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
}

.chat-input button {
    border-radius: 25px;
    min-width: 80px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 10px 30px var(--shadow);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--accent-primary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .dashboard-container {
        padding: 20px 15px;
    }
    
    .agents-grid {
        grid-template-columns: 1fr;
    }
    
    .chat-container {
        flex-direction: column;
    }
    
    .chat-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .auth-card {
        padding: 30px 20px;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
    }
}

/* Image Upload Styles */
.image-upload-container {
    margin-bottom: 1rem;
}

.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-upload-area:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.image-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.image-upload-placeholder i {
    font-size: 2rem;
    color: var(--accent-primary);
}

.image-upload-placeholder p {
    font-size: 1rem;
    margin: 0;
}

.image-upload-placeholder small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.image-preview {
    position: relative;
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 12px var(--shadow);
}

.remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.remove-image:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Agent Image Display */
.agent-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.agent-image:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.agent-card .agent-image {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

/* Chat Agent Image */
.chat-agent-info .agent-image {
    width: 50px;
    height: 50px;
    margin-right: 1rem;
}
