/* Location Tracker Project Table Styles */

.lt-project-table-wrapper {
    width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Sidebar Layout */
.lt-project-table-wrapper.lt-with-sidebar {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.lt-sidebar {
    flex: 0 0 250px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.lt-sidebar-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.lt-sidebar-header h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.lt-clear-filter {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.lt-clear-filter:hover {
    background: #dc2626;
}

.lt-lga-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lt-lga-item {
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lt-lga-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.lt-lga-item.active {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
    font-weight: 500;
}

.lt-lga-count {
    background: #e5e7eb;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.lt-lga-item.active .lt-lga-count {
    background: #3b82f6;
    color: #fff;
}

.lt-lga-loading,
.lt-lga-error {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-style: italic;
    font-size: 14px;
}

.lt-lga-error {
    color: #dc2626;
}

.lt-main-content {
    flex: 1;
    min-width: 0;
}

.lt-search-wrapper {
    margin-bottom: 20px;
}

.lt-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.lt-search-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.lt-table-container {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lt-projects-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.lt-projects-table thead {
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.lt-projects-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lt-projects-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s;
}

.lt-projects-table tbody tr:hover {
    background-color: #f9fafb;
}

.lt-projects-table tbody tr:last-child {
    border-bottom: none;
}

.lt-projects-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: #1f2937;
}

.lt-loading,
.lt-no-results,
.lt-error {
    text-align: center;
    padding: 40px 20px !important;
    color: #6b7280;
    font-style: italic;
}

.lt-error {
    color: #dc2626;
}

.lt-project-title {
    font-weight: 500;
    color: #1f2937;
}

.lt-project-cost {
    font-weight: 500;
    color: #059669;
}

.lt-project-progress {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.lt-progress-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.lt-progress-in-progress,
.lt-progress-ongoing {
    background-color: #dbeafe;
    color: #1e40af;
}

.lt-progress-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.lt-progress-not-started {
    background-color: #f3f4f6;
    color: #374151;
}

.lt-action-link {
    display: inline-block;
    padding: 6px 14px;
    background-color: #4a90e2;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.lt-action-link:hover {
    background-color: #357abd;
    color: #fff;
}

.lt-pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 16px 0;
}

.lt-pagination-btn {
    padding: 10px 20px;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.lt-pagination-btn:hover:not(:disabled) {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

.lt-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lt-page-info {
    font-size: 14px;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .lt-project-table-wrapper.lt-with-sidebar {
        flex-direction: column;
    }
    
    .lt-sidebar {
        flex: 0 0 auto;
        width: 100%;
        position: static;
        max-height: none;
        margin-bottom: 20px;
    }
    
    .lt-lga-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }
}

/* Tablet Responsive */
@media (max-width: 768px) {
    .lt-projects-table {
        font-size: 12px;
        min-width: 600px; /* Reduce min-width for tablets */
    }
    
    .lt-projects-table th,
    .lt-projects-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .lt-pagination-wrapper {
        flex-direction: column;
        gap: 12px;
    }
    
    .lt-pagination-btn {
        width: 100%;
    }
    
    .lt-lga-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Mobile Responsive - Card Layout */
@media (max-width: 640px) {
    /* Hide the table, show card layout */
    .lt-table-container {
        border: none;
        background: transparent;
        box-shadow: none;
    }
    
    .lt-projects-table thead {
        display: none;
    }
    
    .lt-projects-table,
    .lt-projects-table tbody,
    .lt-projects-table tr,
    .lt-projects-table td {
        display: block;
        width: 100%;
    }
    
    .lt-projects-table {
        min-width: 0;
    }
    
    .lt-projects-table tbody tr {
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 16px;
        padding: 16px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border-bottom: none;
    }
    
    .lt-projects-table tbody tr:hover {
        background-color: #f9fafb;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }
    
    .lt-projects-table td {
        padding: 8px 0;
        border: none;
        text-align: left;
        position: relative;
        padding-left: 45%;
        min-height: 32px;
        display: flex;
        align-items: center;
    }
    
    .lt-projects-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 42%;
        padding-right: 10px;
        font-weight: 600;
        font-size: 12px;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .lt-projects-table td:first-child {
        padding-top: 0;
        font-weight: 600;
        font-size: 15px;
        border-bottom: 1px solid #e5e7eb;
        padding-bottom: 12px;
        margin-bottom: 8px;
    }
    
    .lt-projects-table td:last-child {
        padding-bottom: 0;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #e5e7eb;
        justify-content: center;
        padding-left: 0;
    }
    
    .lt-projects-table td:last-child:before {
        display: none;
    }
    
    .lt-action-link {
        width: 100%;
        text-align: center;
        padding: 10px 16px;
    }
    
    .lt-sidebar {
        padding: 15px;
    }
    
    .lt-lga-list {
        grid-template-columns: 1fr;
    }
    
    .lt-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .lt-project-table-wrapper {
        margin: 10px 0;
    }
    
    .lt-projects-table tbody tr {
        padding: 12px;
    }
    
    .lt-projects-table td {
        padding-left: 40%;
        font-size: 13px;
    }
    
    .lt-projects-table td:before {
        width: 38%;
        font-size: 11px;
    }
    
    .lt-project-progress {
        font-size: 11px;
        padding: 3px 10px;
    }
}
.lt-table-content,
.lt-main-content {
    flex: 1;
    min-width: 0;
}


/* --- Sidebar Toggle (Mobile Enhancements) --- */
.lt-toggle-sidebar-btn {
    display: none;
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.lt-toggle-sidebar-btn:hover {
    background-color: #1e40af;
}

/* Show toggle on smaller screens */
@media (max-width: 1024px) {
    .lt-toggle-sidebar-btn {
        display: inline-block;
    }

    /* Initially hide sidebar on mobile */
    .lt-sidebar {
        display: none;
    }

    /* When active */
    .lt-sidebar.lt-visible {
        display: block;
        position: relative;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 20px;
        z-index: 20;
        animation: slideDown 0.3s ease;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
}
