/* ========================================
   Projects Public Styles
   Ported from Desktop Planroom for web consistency
   ======================================== */

/* ----------------------------------------
   Projects Table (UserProfile page)
   ---------------------------------------- */
.projects-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.projects-table thead th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border: none;
    white-space: nowrap;
}

.projects-table tbody tr {
    transition: background-color 0.15s ease;
}

.projects-table tbody tr:hover {
    background-color: var(--bg-hover);
}

.projects-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.projects-table .project-number {
    font-family: monospace;
    font-size: 0.85rem;
    color: #666;
}

.projects-table .project-name {
    font-weight: 500;
}

.projects-table .project-name a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.projects-table .project-name a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.projects-table .bid-date {
    white-space: nowrap;
}

.projects-table .bid-today {
    color: #dc3545;
    font-weight: 600;
}

.projects-table .bid-upcoming {
    color: #198754;
}

.projects-table .bid-past {
    color: var(--text-muted);
}

/* Search/filter toolbar */
.projects-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
}

.search-input {
    width: 300px;
    min-width: 150px;
    flex-shrink: 1;
}

/* Pagination controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-light);
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* No results */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
    background-color: var(--bg-light);
    border-radius: 8px;
}

.no-results .oi {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ----------------------------------------
   Project Detail Page (ProjectDetail page)
   ---------------------------------------- */
.project-detail {
    background: var(--bg-light);
    min-height: 100%;
}

/* Header with Date Badge */
.overview-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.date-badge .month {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #c4dff5;
}

.date-badge .day {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.header-info {
    flex: 1;
    min-width: 0;
}

.header-info .project-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.project-location-time {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.project-location-time .oi {
    margin-right: 0.25rem;
    color: var(--primary-color);
}

/* Status badges */
.status-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.bid-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.bid-status-badge.bidding {
    background-color: #d4edda;
    color: #155724;
}

.bid-status-badge.today {
    background-color: #fff3cd;
    color: #856404;
}

.bid-status-badge.past {
    background-color: #e9ecef;
    color: #495057;
}

/* Section Cards */
.section-card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    background: var(--primary-color);
    margin: 0;
    padding: 0.6rem 1rem;
}

.section-card-content {
    padding: 1rem;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #666;
    font-weight: 500;
}

.detail-value {
    color: #333;
    text-align: right;
}

/* Description */
.description-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
}

/* Files Overview */
.files-overview-content {
    padding: 1rem;
}

.files-summary {
    margin-bottom: 1rem;
}

.files-total {
    font-size: 1rem;
    color: #333;
}

.files-total .oi {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.folder-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-light);
    border-radius: 6px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
}

.folder-item:hover {
    background-color: var(--bg-hover);
}

.folder-item .folder-icon {
    color: #f0ad4e;
    font-size: 1.1rem;
}

.folder-item .folder-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-item .folder-count {
    font-size: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
}

/* File list */
.file-list {
    display: flex;
    flex-direction: column;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background-color: var(--bg-hover);
}

.file-item .file-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.file-item .file-icon.pdf { color: #dc3545; }
.file-item .file-icon.word { color: #0d6efd; }
.file-item .file-icon.excel { color: #198754; }
.file-item .file-icon.image { color: #0dcaf0; }
.file-item .file-icon.archive { color: #ffc107; }
.file-item .file-icon.default { color: var(--text-muted); }

.file-item .file-info {
    flex: 1;
    min-width: 0;
}

.file-item .file-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item .file-path {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-item .file-size {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Bid Packages Table */
.bid-packages-table {
    width: 100%;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.bid-packages-table thead th {
    background-color: #e9ecef;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid var(--border-color);
    padding: 0.6rem 0.75rem;
}

.bid-packages-table tbody td {
    vertical-align: top;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.bid-packages-table tbody tr:last-child td {
    border-bottom: none;
}

/* Contact Groups */
.contacts-content {
    padding: 1rem;
}

.contact-group {
    margin-bottom: 1rem;
}

.contact-group:last-child {
    margin-bottom: 0;
}

.contact-group-header {
    background: #495057;
    color: white;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 4px 4px 0 0;
}

.contact-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr 1fr;
    gap: 1rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid #e9ecef;
    border-top: none;
    font-size: 0.85rem;
    align-items: center;
}

.contact-row:last-child {
    border-radius: 0 0 4px 4px;
}

.contact-company {
    font-weight: 500;
}

.contact-company .oi {
    color: var(--primary-color);
    margin-right: 0.35rem;
}

.contact-email a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-email a:hover {
    text-decoration: underline;
}

.contact-phone {
    color: #666;
}

.contact-phone a {
    color: inherit;
    text-decoration: none;
}

.contact-phone a:hover {
    text-decoration: underline;
}

.contact-location {
    color: #666;
    text-align: right;
}

/* Bidder-specific styles */
.bidder-row {
    grid-template-columns: 2fr 2fr 1.5fr auto;
}

.bidder-status {
    display: flex;
    gap: 0.35rem;
    justify-content: flex-end;
}

/* Bid Results Table */
.bid-results-table tbody tr.low-bidder-row {
    background-color: #d4edda;
}

.bid-results-table tbody tr.awarded-row {
    background-color: #cfe2ff;
}

.bid-results-table tbody tr.low-bidder-row.awarded-row {
    background: linear-gradient(135deg, #d4edda 50%, #cfe2ff 50%);
}

/* Published info */
.published-info {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.published-info a {
    color: var(--primary-color);
}

/* ----------------------------------------
   Responsive Styles
   ---------------------------------------- */
@media (max-width: 991.98px) {
    .details-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 767.98px) {
    /* Projects table - convert to stacked cards on mobile */
    .projects-table thead {
        display: none;
    }

    .projects-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 1rem;
        background: white;
    }

    .projects-table tbody td {
        display: block;
        padding: 0.25rem 0;
        border-bottom: none;
        text-align: left;
    }

    .projects-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        display: block;
        font-size: 0.75rem;
        text-transform: uppercase;
        margin-bottom: 0.15rem;
    }

    .projects-table .project-name {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .projects-table .project-number {
        font-size: 0.8rem;
    }

    /* Project detail header */
    .overview-header {
        flex-direction: column;
        text-align: center;
    }

    .date-badge {
        align-self: center;
    }

    .project-location-time {
        justify-content: center;
    }

    /* Contact rows - 2 columns on mobile */
    .contact-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .contact-location {
        text-align: left;
    }

    /* Folder list */
    .folder-list {
        grid-template-columns: 1fr;
    }

    /* Search toolbar */
    .projects-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-section {
        flex-wrap: wrap;
    }

    .search-input {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    /* Contact rows - single column on small mobile */
    .contact-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .bidder-row {
        grid-template-columns: 1fr;
    }

    .contact-company,
    .contact-email,
    .contact-phone,
    .contact-location,
    .bidder-status {
        text-align: left;
        justify-content: flex-start;
    }
}
