/* Admin Dashboard - Dark Theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

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

.login-card h1 {
    text-align: center;
    color: #fff;
    margin-bottom: 5px;
    font-size: 28px;
}

.subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 30px;
    font-size: 14px;
}

.footer-note {
    text-align: center;
    color: #666;
    font-size: 12px;
    margin-top: 20px;
}

/* Admin Dashboard */
.admin-dashboard {
    background: #0f0f0f;
    min-height: 100vh;
}

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

.admin-header {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 20px 30px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    color: #fff;
    font-size: 24px;
    margin-bottom: 4px;
}

.header-subtitle {
    color: #888;
    font-size: 14px;
}

/* Navigation */
.admin-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.nav-item {
    background: #1e1e1e;
    border: none;
    color: #e0e0e0;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-item:hover {
    background: #2a2a2a;
}

.nav-item.active {
    background: #667eea;
    color: #fff;
}

/* Tab Panes */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.stat-label {
    color: #888;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cards */
.card {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.card h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 20px;
}

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

.card-header h3 {
    margin: 0;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #2a2a2a;
}

.data-table th {
    padding: 12px;
    text-align: left;
    color: #667eea;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #2a2a2a;
    color: #e0e0e0;
}

.data-table tbody tr:hover {
    background: #252525;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: #2a2a2a;
    color: #e0e0e0;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-active, .status-healthy {
    background: #4caf50;
    color: white;
}

.status-pending {
    background: #ff9800;
    color: white;
}

.status-confirmed {
    background: #2196f3;
    color: white;
}

.status-completed {
    background: #4caf50;
    color: white;
}

.status-cancelled, .status-suspended {
    background: #f44336;
    color: white;
}

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

.form-group label {
    display: block;
    color: #bbb;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 14px;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #667eea;
    background: #303030;
}

.search-input {
    max-width: 300px;
}

.filters {
    display: flex;
    gap: 10px;
}

.filters select {
    width: auto;
    min-width: 150px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #2a2a2a;
    color: #e0e0e0;
}

.btn-secondary:hover {
    background: #3a3a3a;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

/* Test Conversation */
.conversation-container {
    background: #121212;
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #2a2a2a;
}

.conversation-empty {
    text-align: center;
    color: #666;
    padding: 60px 20px;
}

.test-message {
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 12px;
    max-width: 80%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* Ensure emojis render properly */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
    /* Preserve line breaks as fallback */
    white-space: pre-wrap;
}

.test-message-client {
    background: #2a2a2a;
    color: #e0e0e0;
    margin-left: auto;
}

.test-message-ai {
    background: #667eea;
    color: white;
}

.test-message-error {
    background: #f44336;
    color: white;
}

/* Extraction Display */
.extraction-items {
    display: grid;
    gap: 10px;
}

.extraction-item {
    background: #2a2a2a;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.extraction-item.highlight {
    border-left-color: #4caf50;
    background: #1a3a1a;
}

.extraction-item strong {
    color: #667eea;
}

/* Quick Messages */
.quick-messages {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #2a2a2a;
}

.quick-messages p {
    margin-bottom: 10px;
    color: #888;
    font-size: 14px;
}

.quick-messages button {
    margin-right: 10px;
    margin-bottom: 10px;
}

/* Activity & Logs */
.activity-item, .log-item {
    padding: 12px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 14px;
}

.activity-time, .log-time {
    color: #888;
    font-size: 12px;
    min-width: 140px;
}

.activity-user, .log-user {
    color: #667eea;
    font-weight: 500;
}

.activity-event, .log-event {
    color: #e0e0e0;
}

/* Error Messages */
.error-message {
    background: #3a1a1a;
    color: #ff6b6b;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 3px solid #f44336;
}

/* Empty States */
.empty-state {
    text-align: center;
    color: #666;
    padding: 40px;
}

/* Utility Classes */
.hint {
    color: #888;
    font-size: 14px;
    margin-bottom: 16px;
}

.content-row {
    display: grid;
    gap: 20px;
}

.text-success {
    color: #4caf50 !important;
}

.text-warning {
    color: #ff9800 !important;
}

.text-error {
    color: #f44336 !important;
}

/* Health Components */
.health-overview {
    font-size: 18px;
    margin-bottom: 20px;
    padding: 16px;
    background: #2a2a2a;
    border-radius: 8px;
}

.health-components {
    display: grid;
    gap: 12px;
}

.health-component {
    padding: 12px;
    background: #252525;
    border-radius: 6px;
}

.health-component strong {
    color: #667eea;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.modal-header h3 {
    margin: 0;
    color: #fff;
}

.modal-close {
    background: none;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: #333;
    color: #fff;
}

.availability-schedule {
    display: grid;
    gap: 10px;
}

.availability-day {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #252525;
    border-radius: 6px;
    border-left: 3px solid #4a9eff;
}

.availability-day.closed {
    border-left-color: #666;
    opacity: 0.6;
}

.availability-day-name {
    font-weight: 600;
    color: #fff;
}

.availability-day-times {
    color: #999;
    font-size: 14px;
}

.availability-day.closed .availability-day-times {
    color: #666;
}

.availability-slot {
    display: inline-block;
    margin-left: 8px;
    padding: 4px 8px;
    background: #333;
    border-radius: 4px;
    font-size: 13px;
}

/* Bulk Availability Form */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.days-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
    padding: 16px;
    background: #252525;
    border-radius: 6px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.checkbox-label:hover {
    color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-header {
        flex-direction: column;
        gap: 16px;
    }

    .admin-nav {
        flex-wrap: wrap;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th, .data-table td {
        padding: 8px;
    }
}
