/* custom_dashboard.css */

/* Global Dashboard Background */
body {
    background: var(--login-bg) !important;
    color: var(--login-text-color) !important;
}

/* Header & Title Stack Restructuring */
.header-left {
    display: flex;
    align-items: center;
}

.header-left .logo {
    font-size: 32px;
    margin-right: 15px;
    line-height: 1;
}

.header-titles-stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-titles-stack .title {
    font-size: 15px;
    font-weight: 600;
    color: var(--login-text-color);
    margin-bottom: 2px;
    line-height: 1;
}

/* Custom Board Selector */
.custom-board-selector {
    margin: 0;
    line-height: 1;
}

.custom-board-selector .board-selector-btn {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px; /* Match standard dropdown shapes better */
    background: rgba(255, 255, 255, 0.5) !important;
    color: #333 !important;
    font-size: 13px;
    border: 1px solid rgba(0,0,0,0.15);
    text-decoration: none;
    transition: all 0.2s;
    width: 140px; /* Fixed width to align with menu */
    box-sizing: border-box;
    text-align: left;
}

.custom-board-selector .board-selector-btn i.fa-caret-down {
    float: right;
    margin-top: 2px;
}

.custom-board-selector .board-selector-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

ul.custom-board-selector-menu {
    overflow: hidden !important; /* Strictly no scrollbars */
    border-radius: 6px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
    border: 1px solid rgba(0,0,0,0.15) !important;
    background: #fff !important;
    padding: 4px 0 !important;
    width: 140px !important; /* Fixed width to match button */
    min-width: 140px !important; 
    margin-top: 8px !important; /* Increased spacing to prevent overlap */
    white-space: nowrap !important; /* Prevent text wrapping so it shrinks to fit */
}

/* Fix Kanboard native li hover nesting */
ul.custom-board-selector-menu li {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
}

ul.custom-board-selector-menu li:hover {
    background: transparent !important;
}

/* Style the links inside the dropdown beautifully */
ul.custom-board-selector-menu li a {
    padding: 8px 12px !important; /* More compact vertically */
    color: #333 !important;
    text-decoration: none !important;
    display: block !important;
    font-size: 13px !important; /* Slightly smaller font */
    transition: background 0.2s, color 0.2s !important;
    border-radius: 0 !important; /* Override default Kanboard link styling if needed */
    box-sizing: border-box !important;
    width: 100% !important;
}

ul.custom-board-selector-menu li a:hover {
    background: var(--login-btn-bg) !important;
    color: var(--login-btn-text) !important;
}

/* Custom divider */
ul.custom-board-selector-menu li hr {
    margin: 4px 0 !important;
    border-top: 1px solid rgba(0,0,0,0.08) !important;
    border-bottom: none !important;
}

/* Sidebar restructuring */
.sidebar-container {
    display: flex;
    margin-top: 20px;
}

.sidebar {
    border-right: none !important;
    width: 160px; /* Slimmer fixed width, no longer 250px */
    padding-right: 20px;
}

.sidebar ul {
    border: none !important;
}

.sidebar ul li {
    margin-bottom: 5px;
    border-radius: 12px;
    transition: all 0.2s ease;
    border-left: none !important;
}

.sidebar ul li:hover, .sidebar ul li.active {
    background: rgba(255, 224, 102, 0.15) !important;
    border-left: none !important;
}

.sidebar ul li a {
    position: relative;
    display: block;
    padding: 10px 0; /* Remove horizontal padding so text centers relative to the full width */
    color: var(--login-text-color) !important;
    font-weight: 500;
    text-align: center;
    border-radius: 8px;
}

.sidebar ul li a i {
    position: absolute;
    left: 15px; /* Fixed position on the left */
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    text-align: center;
    margin: 0; /* Remove previous margins */
}

.sidebar-text {
    display: inline-block;
    width: 5em; /* Exactly 5 characters wide */
    text-align: center; /* Center the text inside the 5-char block */
    margin: 0 auto; /* Center the block inside the a tag */
}

.sidebar ul li.active a {
    color: #f39c12 !important;
    font-weight: 600;
}

/* Page Header links */
.page-header {
    border-bottom: 1px solid var(--login-icon-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.page-header ul {
    border: none !important;
}
.page-header ul li {
    margin-right: 10px !important;
}
.page-header ul li a {
    border-radius: 50px;
    padding: 6px 15px;
    transition: all 0.2s;
    color: var(--login-text-color) !important;
}
.page-header ul li a:hover {
    background: rgba(255, 224, 102, 0.2);
}

/* Cards and Tables (Overview) */
.sidebar-content .table-list {
    background: var(--login-card-bg);
    border-radius: 16px;
    box-shadow: var(--login-shadow);
    border: none !important;
    overflow: hidden;
    margin-top: 15px;
}

.table-list-header {
    background: var(--login-input-bg) !important;
    border: none !important;
    padding: 15px 20px !important;
    color: var(--login-text-color);
}

.table-list-row {
    border: none !important;
    border-bottom: 1px solid var(--login-icon-color) !important;
    padding: 15px 20px !important;
    transition: background 0.2s;
    background: var(--login-card-bg);
}

.table-list-row:hover {
    background: var(--login-input-bg) !important;
}

.table-list-row:last-child {
    border-bottom: none !important;
}

/* Empty state */
.alert {
    border-radius: 12px;
    padding: 20px !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.alert-info {
    background: rgba(255, 224, 102, 0.15) !important;
    color: #d35400 !important;
    text-align: center;
    font-weight: 500;
}

/* Filter bar / Search */
.filter-box {
    background: var(--login-card-bg);
    border-radius: 50px;
    box-shadow: var(--login-shadow);
    padding: 5px 20px;
    display: flex;
    align-items: center;
    border: 1px solid var(--login-icon-color);
}

.filter-box .form-input-group {
    flex-grow: 1;
}

.filter-box input[type="text"] {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    width: 100%;
    color: var(--login-input-text);
}

/* Header general styling */
header {
    background: var(--login-card-bg) !important;
    box-shadow: var(--login-shadow);
    padding: 12px 15px !important;
    border-bottom: none !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-right: 20px;
    font-size: 1.8em; /* Enlarge logo */
}

.title-container {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 1.5em; /* Enlarge title */
    font-weight: 500;
}

.menus-container {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 1.2em; /* Enlarge buttons */
    gap: 10px; /* Add spacing between buttons if they don't have it */
}

.header-center-description {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    font-size: 15px; /* Enlarge info text */
    color: #666;
    margin: 0 0 0 15px; /* Stick close to title container */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 40px; /* Prevent header stretching */
    font-weight: normal; /* Override title font weight */
}

.header-center-description hr {
    display: inline-block;
    width: 1px;
    height: 12px;
    margin: 0 10px;
    background: #ccc;
    border: none;
    vertical-align: middle;
}

.header-center-description p, .header-center-description strong, .header-center-description em {
    display: inline;
    margin: 0 5px;
}

.header-center-description ul, .header-center-description ol {
    display: inline;
    padding: 0;
    margin: 0 5px;
    list-style: none;
}

.header-center-description li {
    display: inline;
    margin-right: 8px;
}



/* Stylings for injected Project Header components */
.menus-container .dropdown-component {
    margin-right: 10px;
    font-size: 14px;
}

.menus-container .views-switcher-component {
    margin-right: 15px;
}

.menus-container .views-switcher-component ul.views {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 8px;
}

.menus-container .views-switcher-component ul.views li {
    background: transparent;
    border: none;
    margin: 0;
}

.menus-container .views-switcher-component ul.views li a {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: normal;
    color: #555;
    background: rgba(0,0,0,0.04);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.menus-container .views-switcher-component ul.views li.active a,
.menus-container .views-switcher-component ul.views li:hover a {
    background: var(--color-primary);
    color: white;
}

.menus-container .views-switcher-component ul.views li.active a i,
.menus-container .views-switcher-component ul.views li:hover a i {
    color: white;
}

.filter-box-component form {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}

.filter-box-component .input-addon-item {
    background: transparent;
    border: none;
}

.filter-box-component .input-addon-field {
    border-radius: 20px;
    padding: 4px 12px;
    border: 1px solid #ccc;
    font-size: 13px;
    width: 200px;
    transition: width 0.3s;
}

.filter-box-component .input-addon-field:focus {
    width: 250px;
    outline: none;
    border-color: var(--color-primary);
}
/* =========================================================
   Project Overview Dashboard Redesign
   ========================================================= */

/* Main Container padding */
.project-overview-dashboard {
    padding: 20px 30px;
}

/* --- KPI Cards Row --- */
.dashboard-kpi-row {
    margin-bottom: 20px;
}

.dashboard-kpi-row .project-overview-columns {
    display: flex;
    gap: 15px;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
}

.dashboard-kpi-row .project-overview-column {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-kpi-row .project-overview-column:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.dashboard-kpi-row .project-overview-column strong {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 6px;
}

.dashboard-kpi-row .project-overview-column small {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* --- Pure CSS Tabs Layout --- */
.tab-radio {
    display: none;
}

.dashboard-tabs-header {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}

.dashboard-tabs-header .tab-btn {
    flex: 1;
    text-align: center;
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: block;
}

.dashboard-tabs-header .tab-btn:hover {
    background: #f5f5f5;
    color: #333;
}

/* Radio button active states mapping to labels */
#tab-desc:checked ~ .dashboard-tabs-header [for="tab-desc"],
#tab-attach:checked ~ .dashboard-tabs-header [for="tab-attach"],
#tab-info:checked ~ .dashboard-tabs-header [for="tab-info"],
#tab-act:checked ~ .dashboard-tabs-header [for="tab-act"] {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.dashboard-tabs-content .tab-pane {
    display: none;
}

/* Radio button active states mapping to panes */
#tab-desc:checked ~ .dashboard-tabs-content .pane-desc,
#tab-attach:checked ~ .dashboard-tabs-content .pane-attach,
#tab-info:checked ~ .dashboard-tabs-content .pane-info,
#tab-act:checked ~ .dashboard-tabs-content .pane-act {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* --- Card Styles (Replaced details with div) --- */
.dashboard-tabs-content .accordion-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 0;
}

.dashboard-tabs-content .accordion-section .accordion-content {
    padding: 25px;
}

.project-overview-dashboard .accordion-content > .panel {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

/* Styling specific content inside cards */
.project-overview-dashboard .accordion-content ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.project-overview-dashboard .accordion-content ul li {
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    color: #555;
}

.project-overview-dashboard .accordion-content ul li:last-child {
    border-bottom: none;
}

.project-overview-dashboard .accordion-content ul li strong {
    color: #222;
}

/* Activity feed timeline style */
.project-overview-dashboard .activity-event {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee;
}

.project-overview-dashboard .activity-event:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.project-overview-dashboard .activity-date {
    font-size: 12px;
    color: #999;
}

@media (max-width: 900px) {
    .dashboard-kpi-row .project-overview-columns {
        flex-direction: column;
    }
    
    .dashboard-tabs-header {
        flex-wrap: wrap;
    }
}

/* =========================================================
   Kanban Board Redesign
   ========================================================= */

/* Main Board Container */
#board {
    border-collapse: separate !important;
    border-spacing: 15px 0 !important;
    margin: 10px 0 !important; /* Removed side margin so 100% width fits perfectly */
    background: transparent !important;
    width: 100% !important;
    table-layout: fixed !important;
}

/* Column Headers */
.board-column-header {
    background-color: #f4f5f7 !important;
    border: none !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 15px !important;
}

/* Column Body */
.board-column {
    background-color: #f4f5f7 !important;
    border: none !important;
    border-radius: 0 0 8px 8px !important;
    padding: 0 10px 15px 10px !important;
    vertical-align: top;
}

/* Remove default column borders */
.board-column-header th, .board-column td {
    border: none !important;
}

/* Header Flexbox Layout */
.board-column-expanded-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
}

.board-column-title {
    font-weight: 700;
    font-size: 15px;
    color: #333;
    flex: 1;
    text-align: left;
    margin-left: 8px;
}

/* Task Count Badge */
.board-column-header-task-count {
    background: #e0e4e8;
    color: #555;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

/* Task Cards */
.task-board {
    background-color: #ffffff !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-left-width: 4px !important;
    border-left-style: solid !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    padding: 12px 15px !important;
    margin-bottom: 12px !important;
    margin-top: 0 !important;
    transition: transform 0.2s, box-shadow 0.2s;
}

.task-board:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.15) !important;
    transform: translateY(-2px);
}

/* Typography inside Tasks */
.task-board-header {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.task-board-header a {
    color: #888 !important;
    font-weight: 500;
}

.task-board-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}

.task-board-title a {
    color: #222 !important;
}

.task-board-title a:hover {
    color: var(--color-primary) !important;
    text-decoration: none;
}

/* Clean up add button */
.board-add-icon {
    color: var(--color-primary) !important;
    font-size: 16px;
    opacity: 0.8;
}

.board-add-icon:hover {
    opacity: 1;
}

/* =========================================================
   New Task / Form Modal Redesign
   ========================================================= */

/* Use CSS Grid for the form container */
.task-form-container {
    display: grid !important;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
}

/* Make columns fill their grid cells */
.task-form-main-column,
.task-form-secondary-column {
    width: 100% !important;
    float: none !important;
}

/* Bottom area spans across all columns */
.task-form-bottom {
    grid-column: 1 / -1;
    margin-top: 15px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* Labels */
.task-form-container label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
    margin-top: 12px;
}

/* Inputs, Selects, Textareas */
.task-form-container input[type="text"],
.task-form-container input[type="number"],
.task-form-container input[type="password"],
.task-form-container select,
.task-form-container textarea {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease !important;
    background-color: #fff !important;
}

/* Focus states for inputs */
.task-form-container input[type="text"]:focus,
.task-form-container input[type="number"]:focus,
.task-form-container input[type="password"]:focus,
.task-form-container select:focus,
.task-form-container textarea:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(52, 104, 192, 0.1) !important;
    outline: none !important;
}

/* Checkboxes */
.task-form-bottom label {
    display: inline-block;
    margin-top: 0;
    margin-right: 15px;
    font-weight: 500;
}

/* Primary Button in Form */
.task-form-bottom .btn-blue {
    padding: 10px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    margin-right: 10px;
}

/* Markdown Editor Toolbar */
.text-editor-toolbar {
    background-color: #f9f9f9;
    border: 1px solid #d1d5db;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 6px 10px;
}

.text-editor-write-mode {
    margin-top: 0 !important;
}

.text-editor-write-mode textarea {
    border-radius: 0 0 6px 6px !important;
    border-top: none !important;
}
