/* projects.css - Nexus AI Theme */
:root {
    --nexus-primary: #4f46e5;
    /* Indigo 600 */
    --nexus-bg: #f8fafc;
    /* Slate 50 */
    --nexus-card-bg: #ffffff;
    --nexus-text: #1e293b;
    /* Slate 800 */
    --nexus-muted: #64748b;
    /* Slate 500 */
    --nexus-border: #e2e8f0;
    /* Slate 200 */

    --nexus-accent-idea: #f59e0b;
    /* Amber 500 */
    --nexus-accent-focus: #6366f1;
    /* Indigo 500 */
    --nexus-accent-done: #10b981;
    /* Emerald 500 */
    --nexus-radius: 16px;
    --nexus-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.nexus-container {
    background-color: var(--nexus-bg);
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
    font-family: 'Inter', sans-serif;
    color: var(--nexus-text);
}

/* Header */
.nexus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.nexus-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nexus-logo-box {
    width: 40px;
    height: 40px;
    background: var(--nexus-primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.nexus-subtitle {
    font-size: 0.75rem;
    color: var(--nexus-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* View Toggles */
.nexus-toggles {
    background: white;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--nexus-border);
    display: flex;
    gap: 4px;
}

.nexus-toggle-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--nexus-muted);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nexus-toggle-btn.active {
    background: #e0e7ff;
    /* Indigo 100 */
    color: var(--nexus-primary);
    font-weight: 600;
}

.nexus-toggle-btn:hover:not(.active) {
    background: #f1f5f9;
}

/* Hero Section */
.nexus-hero {
    background: white;
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 32px;
    border: 1px solid var(--nexus-border);
    box-shadow: var(--nexus-shadow);
    background-image: radial-gradient(circle at right top, #e0e7ff 0%, transparent 25%);
}

.nexus-hero h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #0f172a;
}

.nexus-hero p {
    color: var(--nexus-muted);
    max-width: 600px;
    line-height: 1.6;
}

/* Kanban Board */
.nexus-kanban {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    height: 100%;
}

.kanban-col {
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kanban-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    margin-bottom: 8px;
}

.col-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--nexus-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.col-badge {
    background: white;
    border: 1px solid var(--nexus-border);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.wip-limit {
    font-size: 0.7rem;
    color: var(--nexus-muted);
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Project Card */
.project-card {
    background: white;
    border-radius: 16px;
    padding: 12px;
    border: 1px solid var(--nexus-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    cursor: grab;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--nexus-primary);
}

.project-score {
    position: absolute;
    top: 16px;
    right: 16px;
    font-weight: 700;
    color: var(--nexus-primary);
    background: #e0e7ff;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.8rem;
}

.project-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
    color: #0f172a;
    padding-right: 30px;
}

.project-desc {
    font-size: 0.8rem;
    color: var(--nexus-muted);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--nexus-muted);
    background: #f8fafc;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid var(--nexus-border);
}

.project-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--nexus-muted);
    transition: all 0.2s;
    cursor: pointer;
    font-size: 0.8rem;
}

.action-icon:hover {
    background: #f1f5f9;
    color: var(--nexus-primary);
}

/* Matrix View */
.nexus-matrix {
    display: none;
    flex-grow: 1;
    background: white;
    border-radius: 24px;
    border: 1px solid var(--nexus-border);
    position: relative;
    padding: 20px;
}

.matrix-grid-bg {
    position: absolute;
    inset: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    border: 1px dashed var(--nexus-border);
}

.matrix-quadrant {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 2rem;
    color: #f1f5f9;
    -webkit-user-select: none;
    user-select: none;
    text-transform: uppercase;
}

.matrix-axis-label {
    position: absolute;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--nexus-muted);
    text-transform: uppercase;
}

.label-top {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.label-bottom {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.label-left {
    left: 10px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
}

.label-right {
    right: 10px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
}

.matrix-dot {
    position: absolute;
    width: 48px;
    height: 48px;
    /** Larger click target */
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, 50%);
    /* Center on coords */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dot-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--nexus-primary);
    border: 3px solid white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.matrix-dot:hover .dot-circle {
    transform: scale(1.5);
    background: var(--nexus-accent-idea);
}

.matrix-dot .dot-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 8px;
}

.matrix-dot:hover .dot-tooltip {
    opacity: 1;
}

/* List View */
.nexus-list {
    display: none;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--nexus-border);
    overflow: hidden;
}

.list-table {
    width: 100%;
    border-collapse: collapse;
}

.list-table th {
    text-align: left;
    padding: 16px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--nexus-muted);
    text-transform: uppercase;
    border-bottom: 1px solid var(--nexus-border);
    background: #f8fafc;
}

.list-table td {
    padding: 16px;
    border-bottom: 1px solid var(--nexus-border);
    font-size: 0.9rem;
}

.list-table tr:hover {
    background: #f8fafc;
}

/* Floating AI Chat */
.nexus-ai-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    background: var(--nexus-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.4);
    cursor: pointer;
    transition: all 0.3s;
    z-index: 100;
}

.nexus-ai-fab:hover {
    transform: scale(1.1) rotate(5deg);
}

/* New Project Modal overrides */
.nexus-modal-content {
    background: #f8fafc !important;
    padding: 0 !important;
}

.nexus-modal-header {
    background: white;
    padding: 24px;
    border-bottom: 1px solid var(--nexus-border);
}

.nexus-form-section {
    padding: 24px;
    background: white;
    margin-top: 16px;
    border-top: 1px solid var(--nexus-border);
    border-bottom: 1px solid var(--nexus-border);
}

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

.slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.range-slider {
    width: 100%;
    cursor: pointer;
}

/* --- Calendar Views Support --- */
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    padding: 16px;
}

.month-header {
    text-align: center;
    font-weight: 600;
    color: var(--nexus-muted);
    padding-bottom: 8px;
}

.month-cell {
    background: white;
    min-height: 120px;
    padding: 8px;
    border: 1px solid var(--nexus-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.month-cell:hover {
    border-color: var(--nexus-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.month-cell.disabled {
    background: #f8fafc;
    border-color: transparent;
    cursor: default;
}

.month-cell.disabled:hover {
    transform: none;
    box-shadow: none;
}

.month-cell.holiday {
    background: #fef2f2;
    border-color: #fecaca;
}

.holiday-label {
    font-size: 0.7rem;
    color: #ef4444;
    font-weight: 600;
    line-height: 1.2;
}

.task-bar {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Year View */
.year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    padding: 24px;
}

.year-month {
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--nexus-border);
}

.year-month-title {
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    color: var(--nexus-text);
}

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

.year-day {
    padding: 4px 0;
    border-radius: 4px;
    cursor: pointer;
    color: var(--nexus-muted);
}

.year-day:hover {
    background: #e2e8f0;
    color: var(--nexus-text);
}

.year-day.holiday {
    color: #ef4444;
    font-weight: 700;
    background: #fef2f2;
}

.year-day.rental {
    background: #dbeafe;
    /* Fondo azul suave (Blue 100) */
    color: #1e40af;
    /* Texto azul oscuro (Blue 800) */
    font-weight: 700;
    border-radius: 4px;
}

.year-day.rental.cleaning {
    background: #d1fae5;
    /* Verde suave (Emerald 100) */
    color: #065f46;
    /* Verde oscuro */
}

.year-day.has-tasks {
    position: relative;
}

.year-day.has-tasks::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--nexus-primary);
}

/* View Switcher Active State Override */
.view-btn {
    transition: all 0.2s;
}

.view-btn.active {
    background: white !important;
    color: var(--nexus-primary) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    opacity: 1 !important;
    font-weight: 700 !important;
}

/* --- Project Canvas & Sticky Notes --- */
.nexus-canvas {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #f8fafc;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 20px 20px;
    overflow: hidden;
    cursor: grab;
}

.nexus-canvas:active {
    cursor: grabbing;
}

.sticky-note {
    position: absolute;
    width: 200px;
    min-height: 200px;
    padding: 4px 15px 15px 15px;
    /* Top fixed at 4px */
    background: #fef08a;
    /* Default Yellow */
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    cursor: move;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.2s, box-shadow 0.2s;
    border-bottom-right-radius: 20px 5px;
}

.sticky-note:hover {
    transform: scale(1.02);
    box-shadow: 4px 8px 15px rgba(0, 0, 0, 0.15);
}

.sticky-note.selected {
    outline: 2px solid var(--nexus-primary);
}

.sticky-title {
    font-weight: 800;
    font-size: 0.9rem;
    color: #451a03;
    background: transparent;
    border: none;
    outline: none;
    margin: 0;
    width: 100%;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
    padding: 0;
}

.sticky-content {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-size: 0.7rem;
    line-height: 1.4;
    outline: none;
    color: #451a03;
    font-weight: 500;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
    padding: 4px 0 0 0;
}

.sticky-header {
    position: absolute;
    top: -28px;
    right: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: all 0.2s;
    z-index: 110;
    pointer-events: none;
    padding-bottom: 10px;
    /* Puente de contacto */
}

.sticky-note:has(.sticky-title:hover) .sticky-header,
.sticky-header:hover {
    opacity: 1;
    pointer-events: auto;
}

.sticky-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    color: #ef4444;
}

.sticky-btn:hover {
    background: white;
}

/* Connection Delete Button */
.conn-delete-btn {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 200;
    pointer-events: auto;
    transform: translate(-50%, -50%);
}

.conn-delete-btn:hover {
    transform: translate(-50%, -50%) scale(1.2);
    background: #dc2626;
}

/* We'll use JS to handle the hover trigger more reliably */
.conn-delete-btn.visible {
    opacity: 1;
}

.connection-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.connection-path {
    fill: none;
    stroke: var(--nexus-primary);
    stroke-width: 2;
    stroke-dasharray: 5, 5;
    marker-end: url(#arrowhead);
}

/* Colors for sticky notes */
.sticky-yellow {
    background: #fef08a;
}

.sticky-blue {
    background: #bfdbfe;
}

.sticky-green {
    background: #bbf7d0;
}

.sticky-pink {
    background: #fbcfe8;
}

.sticky-orange {
    background: #fed7aa;
}

.sticky-purple {
    background: #e9d5ff;
}

.sticky-red {
    background: #fca5a5;
}

/* Color Picker inside sticky */
.sticky-color-picker {
    display: flex;
    gap: 4px;
    background: white;
    padding: 2px 6px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.1s;
}

.color-dot:hover {
    transform: scale(1.2);
}

/* Connection handle */
.connection-handle {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: var(--nexus-primary);
    border: 2px solid white;
    border-radius: 50%;
    cursor: crosshair;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.2s;
}

.sticky-note:hover .connection-handle {
    opacity: 1;
}

/* Folder Navigation System */
.folder-nav-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 10px 4px;
    overflow-x: auto;
    scrollbar-width: thin;
    border-bottom: 1px solid var(--nexus-border);
}

.folder-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    min-width: 70px;
    transition: all 0.2s;
    position: relative;
    padding: 4px 8px;
    border-radius: 8px;
}

.folder-item:hover {
    background: #eff6ff;
}

.folder-item.active {
    background: #dbeafe;
}

.folder-icon {
    width: 38px;
    height: 32px;
    background: #3b82f6;
    position: relative;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.folder-icon::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    width: 14px;
    height: 5px;
    background: #3b82f6;
    border-radius: 2px 2px 0 0;
}

.folder-item:hover .folder-icon {
    transform: translateY(-2px);
    background: #2563eb;
}

.folder-item:hover .folder-icon::before {
    background: #2563eb;
}

.folder-delete-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 11px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.folder-item:hover .folder-delete-btn {
    opacity: 1;
}

.folder-delete-btn:hover {
    transform: scale(1.1);
    background: #dc2626;
}

.folder-name {
    font-size: 0.65rem;
    font-weight: 800;
    color: #1e293b;
    text-transform: uppercase;
    text-align: center;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: none;
    background: transparent;
    outline: none;
}

.btn-add-folder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.4);
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 0;
}

.btn-add-folder:hover {
    transform: scale(1.1);
    background: #2563eb;
}

/* Document List styling */
.doc-file-icon,
.doc-drive-icon,
.doc-url-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1rem;
    flex-shrink: 0;
}

.doc-file-icon {
    background: #f1f5f9;
}

.doc-drive-icon {
    background: #d1fae5;
}

.doc-url-icon {
    background: #e0e7ff;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid var(--nexus-border);
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}
