/* ===========================
   COMPREHENSIVE DESIGN OVERHAUL
   MODERN & USER-FRIENDLY
   =========================== */


/* Filter and Search Bar */
.filter-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    border: 1px solid #e8eaed;
}

.filter-section .row {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex-wrap: wrap;
    row-gap: 10px;
}

.filter-section > div > .row > div {
    display: flex;
    align-items: center;
}

.filter-section input,
.filter-section select {
    border-radius: 8px;
    border: 1.5px solid #e0e0e0;
    padding: 10px 12px !important;
    transition: all 0.2s ease;
    height: 40px;
    width: 100%;
}

.filter-section input:focus,
.filter-section select:focus {
    border-color: #4a90e2 !important;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1) !important;
}

/* Search Clear Icon */
#clearSearch,
.clear-search-btn,
[class*="clearSearch"],
[id*="clearSearch"] {
    cursor: pointer;
    color: #999 !important;
    transition: all 0.2s ease;
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    white-space: nowrap;
    min-width: 32px;
    height: 32px;
}

#clearSearch:hover,
.clear-search-btn:hover,
[class*="clearSearch"]:hover,
[id*="clearSearch"]:hover {
    color: #4a90e2 !important;
    background: #f5f7fa;
}

/* Form control small styling */
.form-control-sm {
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
    height: 40px !important;
    transition: all 0.2s ease;
    background: white !important;
}

.form-control-sm:focus {
    border-color: #4a90e2 !important;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1) !important;
    background: white !important;
}

/* Small button styling */
.btn-sm {
    padding: 8px 14px !important;
    font-size: 13px !important;
    height: 40px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-outline-secondary {
    border: 1.5px solid #e0e0e0 !important;
    color: #333 !important;
    background: white !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease;
    min-width: 80px;
    padding: 8px 12px !important;
}

.btn-outline-secondary:hover {
    border-color: #4a90e2 !important;
    color: #4a90e2 !important;
    background: #f5f7fa !important;
}

.btn-outline-secondary:focus {
    border-color: #4a90e2 !important;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1) !important;
}

/* Filter buttons styling */
.filter-section .btn-outline-secondary,
.filter-btn,
[class*="filter-btn"] {
    border: 1.5px solid #e0e0e0 !important;
    color: #333 !important;
    background: white !important;
    border-radius: 8px !important;
    padding: 10px 16px !important;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 14px;
}

.filter-section .btn-outline-secondary:hover,
.filter-btn:hover,
[class*="filter-btn"]:hover {
    border-color: #4a90e2 !important;
    color: #4a90e2 !important;
    background: #f5f7fa !important;
}

.filter-section .btn-outline-secondary:focus,
.filter-btn:focus {
    border-color: #4a90e2 !important;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1) !important;
}

/* Card Layout Improvements */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    background: #fff;
    margin-bottom: 20px;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.card-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f2f5 100%);
    border: none;
    border-bottom: 1px solid #e8eaed;
    border-radius: 12px 12px 0 0;
    padding: 20px !important;
}

.card-body {
    padding: 20px !important;
}

/* Task Form Styling */
.task-form-wrapper {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group-wrapper {
    display: flex;
    flex-direction: column;
}

.form-group-wrapper label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 13px;
}

.form-group-wrapper input,
.form-group-wrapper select,
.form-group-wrapper textarea {
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group-wrapper input:focus,
.form-group-wrapper select:focus,
.form-group-wrapper textarea:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
    outline: none;
}

/* Badge and Status Styling */
.badge-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-in-progress {
    background: #cfe2ff;
    color: #084298;
}

.badge-completed {
    background: #d1e7dd;
    color: #0f5132;
}

.badge-high {
    background: #f8d7da;
    color: #842029;
}

.badge-medium {
    background: #fff3cd;
    color: #664d03;
}

.badge-low {
    background: #d1e7dd;
    color: #0f5132;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f5f7fa;
    color: #4a90e2;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.action-button:hover {
    background: #4a90e2;
    color: white;
}

.action-button.edit {
    color: #4a90e2;
}

.action-button.delete {
    color: #dc3545;
}

.action-button.delete:hover {
    background: #dc3545;
    color: white;
}

/* Dropdown Menu Enhancements */
.action .dropdown-menu li a {
    white-space: nowrap;
    color: #333;
    text-decoration: none;
}

.action .dropdown-menu li a:hover {
    color: #4a90e2;
}

/* Table cell with dropdown positioning */
td .action-cus {
    position: relative;
}

.table tbody td {
    position: relative;
    overflow: visible !important;
}

.table tbody tr {
    position: relative;
}

/* Ensure dropdown doesn't get cut off */
.table-responsive {
    overflow: visible !important;
}

.table {
    overflow: visible !important;
}

/* Alert Messages */
.alert {
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
    font-size: 13px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border-left-color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
    border-left-color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
    border-left-color: #664d03;
}

.alert-info {
    background-color: #cfe2ff;
    color: #084298;
    border-left-color: #084298;
}

/* Modal Dialog Improvements */
.modal-dialog {
    max-width: 600px;
}

.modal-dialog.modal-lg {
    max-width: 900px;
}

.modal-dialog.modal-xl {
    max-width: 1200px;
}

/* Checkbox and Radio */
.form-check {
    padding-left: 0;
    margin-bottom: 15px;
}

.form-check-input {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    margin-top: 2px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: #4a90e2;
    border-color: #4a90e2;
}

.form-check-label {
    cursor: pointer;
    margin-bottom: 0;
    color: #333;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top-color: #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-state-description {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

/* Pill Button */
.btn-pill {
    border-radius: 25px !important;
    padding: 8px 20px !important;
}

/* Button Group */
.btn-group-cus {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Link Styling */
a {
    color: #4a90e2;
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: #357abd;
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .filter-section {
        padding: 15px;
    }

    .table {
        font-size: 12px;
    }

    .table thead th,
    .table tbody td {
        padding: 10px !important;
    }

    .btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    .modal-dialog {
        margin: 15px;
    }

    .page-header {
        padding: 20px;
    }

    .page-header h1 {
        font-size: 24px;
    }
}

@media (max-width: 576px) {
    .page-header {
        padding: 20px;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .task-form-wrapper {
        padding: 20px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 5px;
    }

    .action-button {
        width: 100%;
        justify-content: flex-start;
        padding-left: 10px;
    }

    .table {
        overflow-x: auto;
        display: block;
    }

    .table thead,
    .table tbody,
    .table th,
    .table td,
    .table tr {
        display: block;
    }

    .table thead {
        display: none;
    }

    .table tr {
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        display: block;
    }

    .table td {
        text-align: right;
        padding-left: 50% !important;
        position: relative;
    }

    .table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 50%;
        padding-left: 15px;
        font-weight: 600;
        text-align: left;
    }
}

/* Print Styles */
@media print {
    .filter-section,
    .action-buttons,
    .btn,
    .dropdown {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #e0e0e0;
    }

    .table {
        box-shadow: none;
    }
}
