/* Ashley's ATC AI Assistant - Styles */
/* White background with green text theme */

:root {
    --primary-color: #2e7d32;
    --primary-light: #4caf50;
    --primary-dark: #1b5e20;
    --background-color: #ffffff;
    --surface-color: #f5f5f5;
    --text-primary: #2e7d32;
    --text-secondary: #388e3c;
    --text-muted: #66bb6a;
    --border-color: #c8e6c9;
    --danger-color: #d32f2f;
    --warning-color: #f57c00;
    --success-color: #388e3c;
    --shadow: 0 2px 8px rgba(46, 125, 50, 0.1);
    --shadow-lg: 0 4px 16px rgba(46, 125, 50, 0.15);
    --radius: 8px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

#app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 220px;
    background: linear-gradient(180deg, #1b5e20 0%, #2e7d32 100%);
    color: white;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.logo h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.logo p {
    font-size: 0.85rem;
    opacity: 0.9;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: white;
}

.nav-item .icon {
    font-size: 1.2rem;
    margin-right: 12px;
}

.nav-item .label {
    font-size: 0.95rem;
}

.api-status {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff5252;
}

.status-indicator.connected {
    background: #69f0ae;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 20px 30px;
    min-height: 100vh;
}

.tab-content {
    display: none;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.section-header h1 {
    font-size: 1.8rem;
    color: var(--primary-dark);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: var(--border-color);
}

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

.btn-danger:hover {
    background: #b71c1c;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--surface-color);
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: var(--transition);
    background: white;
    color: var(--text-primary);
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.input-with-button {
    display: flex;
    gap: 8px;
}

.input-with-button input {
    flex: 1;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input,
.radio-label input {
    width: auto;
    accent-color: var(--primary-color);
}

/* Chat Section */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 150px);
    background: var(--surface-color);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    background: white;
    border: 1px solid var(--border-color);
}

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

.message.assistant .message-content {
    background: white;
}

.chat-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius) var(--radius);
}

.input-wrapper {
    display: flex;
    gap: 10px;
}

.input-wrapper textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    resize: none;
    font-size: 0.95rem;
    font-family: inherit;
    max-height: 120px;
}

.input-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-options {
    margin-top: 10px;
    font-size: 0.85rem;
}

/* Image Section */
.image-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    height: calc(100vh - 150px);
}

.image-form {
    background: var(--surface-color);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.image-results {
    background: var(--surface-color);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow-y: auto;
}

.image-results h3 {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.image-gallery img {
    width: 100%;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.image-gallery img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.image-item {
    position: relative;
}

.image-item .image-actions {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: var(--transition);
}

.image-item:hover .image-actions {
    opacity: 1;
}

.placeholder-text {
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
    font-style: italic;
}

/* Brain Section */
.brain-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    height: calc(100vh - 150px);
}

.brain-upload,
.brain-documents,
.brain-preview {
    background: var(--surface-color);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow-y: auto;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(46, 125, 50, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(46, 125, 50, 0.1);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.supported-formats {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.upload-progress {
    margin-top: 16px;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.documents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.documents-list {
    max-height: calc(100% - 120px);
    overflow-y: auto;
}

.document-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.document-item:hover {
    border-color: var(--primary-color);
}

.document-item .doc-icon {
    font-size: 1.5rem;
    margin-right: 12px;
}

.document-item .doc-info {
    flex: 1;
}

.document-item .doc-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.document-item .doc-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.document-item .doc-delete {
    opacity: 0;
    transition: var(--transition);
}

.document-item:hover .doc-delete {
    opacity: 1;
}

.brain-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.preview-content {
    background: white;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    min-height: 200px;
    max-height: calc(100% - 60px);
    overflow-y: auto;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

/* Calendar Section */
.calendar-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    height: calc(100vh - 150px);
}

.calendar-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mini-calendar {
    background: var(--surface-color);
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.mini-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 500;
}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    font-size: 0.8rem;
}

.mini-calendar-grid .day-name {
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px;
}

.mini-calendar-grid .day-number {
    padding: 6px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.mini-calendar-grid .day-number:hover {
    background: var(--border-color);
}

.mini-calendar-grid .day-number.today {
    background: var(--primary-color);
    color: white;
}

.mini-calendar-grid .day-number.has-task {
    font-weight: 700;
    color: var(--primary-dark);
}

.mini-calendar-grid .day-number.selected {
    outline: 2px solid var(--primary-color);
}

.upcoming-tasks {
    background: var(--surface-color);
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    flex: 1;
    overflow-y: auto;
}

.upcoming-tasks h3 {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upcoming-item {
    padding: 10px;
    background: white;
    border-radius: var(--radius);
    border-left: 3px solid var(--primary-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.upcoming-item:hover {
    background: var(--surface-color);
}

.upcoming-item .task-time {
    font-weight: 600;
    color: var(--primary-color);
}

.upcoming-item .task-title {
    margin-top: 4px;
}

.calendar-main {
    display: flex;
    flex-direction: column;
    background: var(--surface-color);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.calendar-header span {
    font-weight: 600;
    font-size: 1.1rem;
    flex: 1;
}

.view-toggle {
    display: flex;
    gap: 4px;
}

.view-toggle .btn.active {
    background: var(--primary-color);
    color: white;
}

.calendar-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.calendar-week-view {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.calendar-week-view .time-column {
    background: white;
    padding: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.calendar-week-view .day-header {
    background: white;
    padding: 12px;
    text-align: center;
    font-weight: 500;
}

.calendar-week-view .day-header.today {
    background: var(--primary-color);
    color: white;
}

.calendar-week-view .hour-cell {
    background: white;
    min-height: 50px;
    padding: 4px;
    position: relative;
}

.calendar-week-view .hour-cell:hover {
    background: var(--surface-color);
}

.calendar-month-view {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.calendar-month-view .month-day {
    background: white;
    min-height: 100px;
    padding: 8px;
}

.calendar-month-view .month-day.other-month {
    background: var(--surface-color);
    color: var(--text-muted);
}

.calendar-month-view .month-day-header {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.calendar-month-view .month-day-header.today {
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.month-task {
    padding: 4px 8px;
    background: var(--primary-light);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 2px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Task Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
}

.modal-header h2 {
    font-size: 1.2rem;
}

.modal-body {
    padding: 20px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--surface-color);
}

.recurrence-options,
.alarm-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Settings Section */
.settings-container {
    max-width: 600px;
}

.settings-group {
    background: var(--surface-color);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.settings-group h3 {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background: var(--primary-dark);
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    background: var(--danger-color);
}

.toast.success {
    background: var(--success-color);
}

/* Task Badge */
.task-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.task-badge.work { background: #e3f2fd; color: #1565c0; }
.task-badge.personal { background: #f3e5f5; color: #7b1fa2; }
.task-badge.meeting { background: #fff3e0; color: #e65100; }
.task-badge.reminder { background: #e8f5e9; color: #2e7d32; }
.task-badge.other { background: #fafafa; color: #616161; }

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .brain-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .brain-preview {
        grid-column: span 2;
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar .logo h2,
    .sidebar .logo p,
    .sidebar .nav-item .label,
    .sidebar .api-status span {
        display: none;
    }
    
    .sidebar .nav-item {
        justify-content: center;
        padding: 12px;
    }
    
    .sidebar .nav-item .icon {
        margin-right: 0;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    .image-container,
    .brain-container,
    .calendar-container {
        grid-template-columns: 1fr;
    }
    
    .brain-preview {
        grid-column: span 1;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Print Styles */
@media print {
    .sidebar,
    .modal,
    .toast {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
}