/* 
 * Shared Screen Styles for CrowdCoder Connect
 * These styles are used across multiple screens for consistent layout and design
 * 
 * DATA GRID USAGE:
 * For consistent data grid styling across the application, use these classes:
 * 
 * Container: <MudPaper Class="data-grid-container">
 * Header: <MudDataGrid HeaderClass="data-grid-header">
 * 
 * This will automatically apply:
 * - No top border on the container
 * - No bottom border on the table-header div
 * - Header cells with only bottom borders (no left/right/top borders)
 * - Custom pagination styling
 */

/* Screen Container */
.screen-container {
    padding: 1.5rem;
}

/* Screen Title */
.screen-title {
    margin-bottom: 1.5rem;
    font-weight: bold;
    color: #475569;
}

/* Table Container */
.table-container {
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

/* Generic data grid container - no borders on top section */
.data-grid-container {
    border-top: none;
}

.data-grid-container .table-header {
    border-bottom: none;
}

/* Table Header */
.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-weight: 600;
}

/* Table Cell Customizations */
.mud-table-cell {
    padding: 0.75rem 1rem;
}

/* MudDataGrid Header Styling - Remove borders except bottom */
/* Aggressively remove all borders from data grid headers except bottom */
/* Ultra-specific selectors to override all MudBlazor defaults */

/* Target all possible header cell variations using generic data-grid-container class */
.data-grid-container thead th,
.data-grid-container thead td,
.data-grid-container thead .mud-table-cell,
.data-grid-container .mud-table thead th,
.data-grid-container .mud-table thead td,
.data-grid-container .mud-table-head th,
.data-grid-container .mud-table-head td,
.data-grid-container .mud-table-head .mud-table-cell,
.data-grid-container .mud-table-head-cell,
.data-grid-container thead th[class*="mud-table"],
.data-grid-container .mud-table-container thead th,
div.data-grid-container table thead th,
div.data-grid-container table thead td,
div.data-grid-container .mud-table thead th,
div.data-grid-container .mud-table thead td,
div.data-grid-container .mud-table-head th,
div.data-grid-container .mud-table-head td,
div.data-grid-container .mud-table-head .mud-table-cell,
/* Generic table-container class */
div.table-container table thead th,
div.table-container table thead td,
div.table-container .mud-table thead th,
div.table-container .mud-table thead td,
div.table-container .mud-table-head th,
div.table-container .mud-table-head td,
div.table-container .mud-table-head .mud-table-cell,
.table-container table thead th,
.table-container table thead td,
.table-container .mud-table-head-cell,
.table-container th[class*="mud-table"],
.table-container .mud-table-container th,
/* Generic data-grid-header class for HeaderClass attribute */
.data-grid-header,
th.data-grid-header,
td.data-grid-header,
.mud-table-cell.data-grid-header,
.mud-table-head .data-grid-header,
.mud-table thead .data-grid-header {
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

/* Additional specificity for MudDataGrid */
.data-grid-container .mud-table-head-cell,
.data-grid-container thead th[class*="mud-table"],
.table-container .mud-table-head-cell,
.table-container thead th[class*="mud-table"] {
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

/* Remove border from the thead element itself */
div.data-grid-container table thead,
div.data-grid-container .mud-table thead,
div.data-grid-container .mud-table-head,
div.table-container table thead,
div.table-container .mud-table thead,
div.table-container .mud-table-head {
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 0 !important;
}

/* Custom pagination styling - no borders for clean look */
.custom-pagination,
.data-grid-container .custom-pagination,
.data-grid-container .mud-table-pagination,
.table-container .custom-pagination,
.table-container .mud-table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem 1.5rem;
    border-top: 0 !important;
    background-color: #ffffff;
}

/* Remove bottom border from table body/rows above pagination */
.data-grid-container .mud-table tbody,
.data-grid-container .mud-table tbody tr:last-child,
.data-grid-container .mud-table tbody tr:last-child td,
.data-grid-container .mud-table-body,
.data-grid-container .mud-table-body tr:last-child,
.data-grid-container .mud-table-body tr:last-child td,
.data-grid-container .mud-table-container,
.data-grid-container .mud-table-root,
.data-grid-container .mud-table,
.data-grid-container tbody,
.data-grid-container tfoot,
.data-grid-container .mud-table-footer,
.data-grid-container .mud-table-footer .mud-table-cell,
.table-container .mud-table tbody,
.table-container .mud-table tbody tr:last-child,
.table-container .mud-table tbody tr:last-child td,
.table-container .mud-table-body,
.table-container .mud-table-body tr:last-child,
.table-container .mud-table-body tr:last-child td,
.table-container .mud-table-container,
.table-container .mud-table-root,
.table-container .mud-table,
.table-container tbody,
.table-container tfoot,
.table-container .mud-table-footer,
.table-container .mud-table-footer .mud-table-cell {
    border-bottom: 0 !important;
}

/* Aggressively remove all borders from the table wrapper and container */
.data-grid-container > div,
.data-grid-container .mud-table-wrapper,
.table-container > div {
    border-bottom: 0 !important;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rows-per-page {
    display: flex;
    align-items: center;
}

/* Override MudDataGrid pager container */
.mud-table-pagination {
    padding: 0 !important;
    border-top: 0 !important;
}

.mud-table-pagination-content {
    width: 100%;
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    gap: 1rem;
}

/* Document Count Display */
.document-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Chip/Pill Sizing */
.mud-chip-size-small {
    height: 24px;
    font-size: 0.75rem;
}

/* Status Chips */
.status-chip-draft {
    background-color: #fef3c7 !important;
    color: #92400e !important;
}

.status-chip-not-started {
    background-color: #e0e7ff !important;
    color: #3730a3 !important;
}

.status-chip-completed {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
}

.status-chip-in-progress {
    background-color: #dbeafe !important;
    color: #1e40af !important;
}

/* Table Empty State */
.table-empty-state {
    padding: 2rem;
    text-align: center;
    color: #64748b;
}

/* Card Container (Alternative to Table) */
.card-container {
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    background-color: white;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    background-color: #f9fafb;
}

/* Screen Section */
.screen-section {
    margin-bottom: 2rem;
}

.screen-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #334155;
}

.screen-section-description {
    color: #64748b;
    margin-bottom: 1rem;
}

/* Form Container */
.form-container {
    background-color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Stats Card */
.stats-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.stats-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #7c257f;
    margin-bottom: 0.5rem;
}

.stats-card-label {
    color: #64748b;
    font-size: 0.875rem;
}

/* Loading State */
.loading-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

/* Icon with Text */
.icon-with-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background-color: #f0e7f1;
    color: #7c257f;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .screen-container {
        padding: 1rem;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .action-buttons {
        flex-direction: column;
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* Hover Effects */
.hover-highlight:hover {
    background-color: #f9fafb;
    transition: background-color 0.2s;
}

/* Text Utilities */
.text-muted {
    color: #64748b;
}

.text-primary {
    color: #7c257f;
}

.text-error {
    color: #dc2626;
}

.text-success {
    color: #16a34a;
}

/* Spacing Utilities */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.pt-4 { padding-top: 1rem; }
.pb-4 { padding-bottom: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

/* Google Places Autocomplete Dropdown Styling */
/* Ensure the autocomplete dropdown appears above MudDialog and matches app styling */
.pac-container {
    z-index: 9999 !important;
    font-family: 'Dosis', sans-serif !important;
    border-radius: 4px;
    margin-top: 4px;
}

.pac-container,
.pac-container * {
    font-family: 'Dosis', sans-serif !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
}

.pac-item {
    font-family: 'Dosis', sans-serif !important;
    font-size: 15px !important;
    padding: 10px 12px !important;
    cursor: pointer;
}

.pac-item span {
    font-size: 15px !important;
}

.pac-item-query {
    font-family: 'Dosis', sans-serif !important;
    font-size: 15px !important;
}

.pac-matched {
    font-family: 'Dosis', sans-serif !important;
    font-size: 15px !important;
    font-weight: 600;
}

.pac-icon {
    margin-top: 2px;
}

