:root {
    --bg-color: #0b0f19;
    --text-color: #f8fafc;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #ec4899;
    --accent-hover: #db2777;
    --scrollbar-bg: rgba(255, 255, 255, 0.02);
    --scrollbar-thumb: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
    background-image: 
        radial-gradient(at 10% 20%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(236, 72, 153, 0.08) 0px, transparent 50%);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
}

.glass-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.glass-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover), #4338ca);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    transition: all 0.5s ease;
}

.sidebar {
    width: 260px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--glass-border);
    padding: 10px 0;
    transition: all 0.4s ease;
}

.logo {
    padding: 25px 20px;
    text-align: center;
}

.logo h2 {
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}

.sidebar nav a {
    color: #94a3b8;
    text-decoration: none;
    padding: 14px 20px;
    margin: 4px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 400;
    border: 1px solid transparent;
}

.sidebar nav a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.02);
}

.sidebar nav a.active {
    color: white;
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.25);
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
}

.sidebar-bottom {
    padding: 20px;
}
.sidebar-bottom button {
    width: 100%;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    padding-bottom: 20px;
}

.top-bar {
    height: 75px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    border-bottom: 1px solid var(--glass-border);
}

.search-bar input {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    width: 320px;
    outline: none;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.25);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s;
}
.icon-btn:hover { 
    transform: scale(1.1); 
    color: white;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.content-area {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* View panels switching */
.view-panel {
    display: none;
    height: 100%;
    animation: fadeIn 0.4s ease;
    flex-direction: column;
}
.view-panel.active {
    display: flex;
}

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

.view-header h2 {
    font-weight: 600;
    font-size: 22px;
}

/* Calendar View */
#calendar-view {
    height: 100%;
}
#calendar {
    height: 100%;
}

/* Tasks Kanban View */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    flex: 1;
    overflow-y: hidden;
    height: 100%;
}
.kanban-column {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}
.col-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}
.col-title.todo { color: #f43f5e; }
.col-title.progress { color: #fbbf24; }
.col-title.done { color: #34d399; }

.badge {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: #94a3b8;
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.task-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
}
.task-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}
.task-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}
.task-card p {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 12px;
    line-height: 1.4;
}
.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}
.priority-tag {
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.priority-1 { background: rgba(244, 63, 94, 0.15); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.2); }
.priority-3 { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.2); }
.priority-5 { background: rgba(52, 211, 153, 0.15); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.2); }

.task-date {
    color: #64748b;
}

/* Notes Grid View */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    overflow-y: auto;
    flex: 1;
    padding-bottom: 20px;
}
.note-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 220px;
}
.note-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
}
.note-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #ffffff;
}
.note-card p {
    font-size: 13.5px;
    color: #94a3b8;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    flex: 1;
}
.note-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 15px;
}
.note-tag {
    background: rgba(255, 255, 255, 0.06);
    color: #64748b;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Documents View */
.doc-upload-container {
    border-radius: 18px;
    padding: 30px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.015);
}
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
}
.upload-icon {
    font-size: 44px;
    display: block;
    margin-bottom: 12px;
}
.upload-zone p {
    font-size: 14px;
    color: #94a3b8;
}

.upload-progress-container {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}
.progress-bar-wrapper {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar {
    background: linear-gradient(to right, var(--primary), var(--accent));
    height: 100%;
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 4px;
}
#upload-progress-text {
    font-size: 13px;
    color: #94a3b8;
    min-width: 35px;
    text-align: right;
}

.doc-list-section {
    border-radius: 18px;
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.015);
}
.doc-list-section h3 {
    margin-bottom: 18px;
    font-size: 16px;
    font-weight: 600;
}

.table-responsive {
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}
.doc-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
}
.doc-table th, .doc-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--glass-border);
}
.doc-table th {
    font-weight: 600;
    color: #64748b;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.doc-table tbody tr {
    transition: all 0.2s;
}
.doc-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}
.doc-table td {
    color: #cbd5e1;
}

.doc-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.doc-status.completed {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
}
.doc-status.processing {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    margin-right: 12px;
    transition: all 0.2s;
    color: #94a3b8;
}
.action-btn:hover {
    transform: scale(1.15);
    color: white;
}
.action-btn.delete:hover {
    color: #f43f5e;
}

/* AI Assistant Panel */
.ai-panel {
    width: 320px;
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(15, 23, 42, 0.2);
}

.ai-panel.hidden {
    transform: translateX(100%);
    position: absolute;
    right: 0;
    height: 100%;
}

.ai-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ai-header h3 {
    font-size: 16px;
    font-weight: 600;
}
.ai-header button {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
}
.ai-header button:hover {
    color: white;
}

.ai-chat {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    padding: 12px 16px;
    border-radius: 14px;
    max-width: 85%;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
    animation: messageFadeIn 0.3s ease;
}
@keyframes messageFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.message.ai {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--glass-border);
    align-self: flex-start;
    color: #cbd5e1;
    border-bottom-left-radius: 4px;
}
.message.user {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.15);
}

.ai-input {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
}
.ai-input input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    outline: none;
    font-size: 13px;
    transition: border-color 0.2s;
}
.ai-input input:focus {
    border-color: var(--primary);
}
.ai-input button {
    padding: 8px 16px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 9, 15, 0.7);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}
.modal-content {
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    padding: 30px;
    background: rgba(20, 24, 38, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalScaleUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalScaleUp {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content h3 {
    margin-bottom: 22px;
    font-size: 18px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group input, .form-group select, .form-group textarea {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 11px 14px;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
    font-size: 13.5px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.35);
}
.form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 13px;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
.btn-danger {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    margin-right: auto;
    font-size: 13px;
}
.btn-danger:hover {
    background: rgba(244, 63, 94, 0.2);
}

.summary-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid var(--glass-border);
    color: #cbd5e1;
}
.extracted-text-box {
    background: rgba(0, 0, 0, 0.2);
    max-height: 200px;
    overflow-y: auto;
    padding: 14px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
    border: 1px solid var(--glass-border);
    color: #cbd5e1;
    white-space: pre-wrap;
}

.hidden {
    display: none !important;
}

/* Focus Mode */
.app-container.focus-active .sidebar {
    width: 0px;
    padding: 0;
    overflow: hidden;
    border-right: none;
}
.app-container.focus-active .ai-panel {
    width: 0px;
    overflow: hidden;
    border-left: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* FullCalendar Overrides for Dark Mode */
.fc-theme-standard td, .fc-theme-standard th, .fc-theme-standard .fc-scrollgrid {
    border-color: var(--glass-border) !important;
}
.fc-button-primary {
    background: rgba(99, 102, 241, 0.15) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    color: #cbd5e1 !important;
    text-transform: capitalize !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
}
.fc-button-primary:hover {
    background: rgba(99, 102, 241, 0.3) !important;
    color: white !important;
}
.fc-button-primary:disabled {
    opacity: 0.4 !important;
}
.fc-button-active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}
.fc .fc-toolbar-title {
    color: var(--text-color);
    font-size: 18px !important;
    font-weight: 600;
}
.fc-day-today {
    background-color: rgba(99, 102, 241, 0.05) !important;
}
.fc-timegrid-slot {
    height: 40px !important;
}
.fc-event {
    border-radius: 6px !important;
    padding: 2px 4px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    cursor: pointer;
}
