/* Monday.com Inspired Theme for RinoTrack */

:root {
    /* Monday.com Color Palette */
    --monday-primary: #0073ea;
    --monday-primary-hover: #0060b9;
    --monday-secondary: #e5f4ff;
    --monday-text-color: #323338;
    --monday-text-secondary: #676879;
    --monday-bg-color: #eceff8;
    /* Light gray/blue background */
    --monday-surface: #ffffff;
    --monday-border-color: #d0d4e4;

    /* Status Colors */
    --status-done: #00c875;
    --status-done-hover: #00b268;
    --status-working: #fdab3d;
    --status-working-hover: #e99729;
    --status-stuck: #e2445c;
    --status-stuck-hover: #ce344c;
    --status-empty: #c4c4c4;

    /* Spacing & Layout */
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 64px;
    --header-height: 60px;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--monday-bg-color);
    color: var(--monday-text-color);
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* === Layout Structure === */
.monday-layout {
    display: flex;
    min-height: 100vh;
}

/* === Sidebar === */
/* DESACTIVADO - Ahora usamos el sidebar unificado (main-sidebar) */
.monday-sidebar {
    display: none !important;
}

.monday-sidebar.collapsed {
    display: none !important;
}

/* Solo ocultar elementos del sidebar antiguo de monday-layout, NO del main-sidebar */
.monday-sidebar .sidebar-header {
    display: none !important;
}

.monday-sidebar .logo-area {
    display: none !important;
}

.monday-sidebar .logo-icon {
    display: none !important;
}

.monday-layout .sidebar-nav {
    display: none !important;
}

.monday-layout .nav-item {
    display: none !important;
}

.monday-sidebar .sidebar-footer {
    display: none !important;
}

.monday-sidebar .user-profile {
    display: none !important;
}

.monday-sidebar .user-avatar {
    display: none !important;
}

/* === Main Content === */
.monday-main {
    flex: 1;
    margin-left: 0;
    padding: 20px 40px;
    transition: margin-left 0.3s ease;
    width: 100%;
}

/* Ajustar cuando el sidebar unificado está presente.
   El espacio del sidebar ya lo da body.padding-left en sidebar.css;
   no volver a restar margen aquí (evita saltos de escala entre páginas). */
body:not(.login-page) .monday-main {
    margin-left: 0;
    width: 100%;
    padding-left: 0;
}

body.sidebar-collapsed:not(.login-page) .monday-main {
    margin-left: 0;
    width: 100%;
    padding-left: 0;
}

@media (max-width: 1024px) {
    body:not(.login-page) .monday-main,
    body.sidebar-collapsed:not(.login-page) .monday-main {
        margin-left: 0;
        width: 100%;
    }
}

/* === Header === */
.main-header {
    margin-bottom: 30px;
}

.header-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--monday-text-color);
    margin: 0;
}

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

.btn-monday {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-size: 14px;
}

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

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

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

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

/* Botón verde (crear) */
.btn-green {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-green:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* === Dashboard Tabs === */
.dashboard-tabs {
    display: flex;
    border-bottom: 1px solid var(--monday-border-color);
    margin-bottom: 20px;
}

.tab-item {
    padding: 10px 20px;
    cursor: pointer;
    color: var(--monday-text-secondary);
    border-bottom: 2px solid transparent;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-item:hover {
    color: var(--monday-primary);
    background-color: rgba(0, 115, 234, 0.05);
}

.tab-item.active {
    color: var(--monday-primary);
    border-bottom-color: var(--monday-primary);
}

/* === Stats Cards === */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--monday-surface);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    border: 1px solid transparent;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--monday-primary);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--monday-text-color);
}

.stat-label {
    color: var(--monday-text-secondary);
    font-size: 13px;
}

/* === Board View (Kanban/List) === */
.board-container {
    background: var(--monday-surface);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    min-height: 500px;
}

.board-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--monday-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
}

.board-title {
    font-size: 18px;
    font-weight: 600;
}

/* Kanban Specifics */
.kanban-wrapper {
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding: 20px;
    gap: 20px;
    height: calc(100vh - 250px);
    align-items: flex-start;
}

.kanban-column {
    min-width: 260px;
    max-width: 260px;
    background-color: #f5f6f8;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.column-header {
    padding: 10px 14px;
    font-weight: 600;
    font-size: 13px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-header.todo {
    background-color: var(--monday-text-secondary);
}

.column-header.working {
    background-color: var(--status-working);
}

.column-header.done {
    background-color: var(--status-done);
}

.column-header.stuck {
    background-color: var(--status-stuck);
}

.column-header .count {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.column-body {
    padding: 8px;
    overflow-y: auto;
    flex: 1;
}

.task-card {
    background: white;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 8px;
    border-left: 3px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
}

.task-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.task-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.task-due-date {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.project-tag {
    font-size: 10px;
    color: #64748b;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: auto;
    /* Pushes to the right */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    border: 1px solid #e2e8f0;
}

.task-card.priority-high {
    border-left-color: var(--status-stuck);
}

.task-card.priority-medium {
    border-left-color: var(--status-working);
}

.task-card.priority-low {
    border-left-color: var(--status-done);
}

.task-checkbox {
    flex-shrink: 0;
    padding-top: 2px;
    display: flex;
    align-items: center;
}

.task-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    padding: 0;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    background-color: #ffffff;
    position: relative;
    flex-shrink: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.task-checkbox input[type="checkbox"]:hover {
    border-color: #10b981;
}

.task-checkbox input[type="checkbox"]:checked {
    background-color: #10b981;
    border-color: #10b981;
}

.task-checkbox input[type="checkbox"]:checked::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.task-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

/* Subtask styles */
.task-card.is-subtask {
    background: linear-gradient(135deg, #f8fafc 0%, #dbeafe 100%);
    border-left-width: 3px;
    border-left-style: dashed;
}

.subtask-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #3b82f6;
    background: #eff6ff;
    border: 1px solid #c2d7fb;
    padding: 1px 5px;
    border-radius: 3px;
    margin-bottom: 2px;
}

.subtask-badge i {
    font-size: 9px;
}

.task-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--monday-text-color);
    margin-bottom: 0;
    line-height: 1.3;
    word-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--monday-text-secondary);
    margin-top: 6px;
}

.task-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-meta i {
    font-size: 10px;
}

.task-assignee {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--monday-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

/* === Task User Info === */
.task-user-info {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
}

.task-user-info small {
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .monday-sidebar {
        width: 0;
        overflow: hidden;
    }

    .monday-sidebar.mobile-open {
        width: 240px;
    }

    .monday-main {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 15px;
    }

    .stats-container {
        grid-template-columns: 1fr 1fr;
    }

    .header-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-actions {
        width: 100%;
        overflow-x: auto;
    }

    .mobile-menu-toggle {
        display: block !important;
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        background: var(--monday-primary);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        z-index: 2000;
        font-size: 24px;
        border: none;
    }
}

.mobile-menu-toggle {
    display: none;
}

/* === Tab Navigation === */
.tabs-container {
    margin-bottom: 20px;
}

.tabs-wrapper {
    display: flex;
    background: #f8fafc;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 0 auto;
}

.tab-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #64748b;
    font-size: 14px;
    position: relative;
}

.tab-button:hover {
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
}

.tab-button.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59,130,246, 0.4);
    transform: translateY(-1px);
}

.tab-button i {
    font-size: 16px;
}

/* === Tab Content === */
.tab-content {
    display: none;
}

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

/* === Loading Container === */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 15px;
}

.loading-container i {
    font-size: 2.5rem;
    color: var(--monday-primary);
}

.loading-container p {
    color: var(--monday-text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

/* === Task User Info === */
.task-user-info {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

/* === Responsive adjustments for tabs === */
@media (max-width: 480px) {
    .tabs-wrapper {
        max-width: 100%;
    }

    .tab-button span {
        display: none;
    }

    .tab-button i {
        font-size: 18px;
    }
}