/* ========================================
   PROPOSALS PAGE STYLES
   ======================================== */

/* ========================================
   HEADER STYLES
   ======================================== */

/* Modern Header Styles */
.proposal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.header-left {
    flex: 0 1 auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #363636;
    margin: 0;
    line-height: 1.2;
}

.proposal-count-pill {
    display: inline-flex;
    align-items: center;
    background: #28d792;
    color: white;
    padding: 0 1.5rem;
    border-radius: 24px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(40, 215, 146, 0.2);
    text-transform: uppercase;
    height: 2.5rem;
    line-height: 1;
}

.proposal-count-pill span {
    color: white;
}

.page-subtitle {
    color: #4a4a4a;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Limited header styles for public/expired users */
.proposal-header-limited {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.proposal-header-limited .header-left {
    flex: 1;
}

.proposal-header-limited .header-right {
    flex: 0 0 auto;
}

.proposal-header-limited .title {
    margin-bottom: 0.5rem;
    color: var(--color-gray-700, #374151);
}

.proposal-header-limited .subtitle {
    margin-bottom: 0;
    color: var(--color-gray-500, #6b7280);
}

.proposal-header-limited .button {
    white-space: nowrap;
}

/* ========================================
   SEARCH STYLES
   ======================================== */

/* Search Styles - Dribbble Inspired */
.search-wrapper {
    position: relative;
    min-width: 280px;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.search-form:hover {
    border-color: #FFED37;
}

.search-form:focus-within {
    border-color: #FFED37;
    box-shadow: 0 0 0 3px rgba(255, 237, 55, 0.2);
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    padding: 0.625rem 1rem;
    font-size: 1rem;
    outline: none;
    color: #363636;
}

.search-input::placeholder {
    color: #9a9a9a;
}

.clear-button {
    background: none;
    border: none;
    padding: 0 0.5rem;
    cursor: pointer;
    color: #9a9a9a;
    transition: color 0.2s;
    outline: none;
}

.clear-button:hover {
    color: #363636;
}

.search-button {
    background: #FFED37;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin: 4px;
    color: rgba(0, 0, 0, 0.7);
    outline: none;
}

.search-button:hover {
    background: #F5E000;
    transform: scale(1.05);
}

.search-button:active {
    transform: scale(0.95);
}

.search-button i {
    font-size: 0.875rem;
}

/* ========================================
   ACTION BUTTONS & DROPDOWNS
   ======================================== */

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

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    color: #363636;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.action-btn:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.action-btn .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown.is-active .dropdown-menu {
    display: block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 240px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 40;
}

.dropdown-content {
    padding: 0.75rem 0;
}

.dropdown-item {
    padding: 0.5rem 1rem;
}

.dropdown-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #363636;
    text-decoration: none;
    padding: 0.5rem 1rem;
    margin: 0 -1rem;
    transition: background 0.2s;
}

.dropdown-item a:hover {
    background: #f5f5f5;
}

.dropdown-header {
    font-weight: 600;
    color: #363636;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid #e8e8e8;
}

.dropdown label {
    display: block;
    padding: 0.25rem 0;
    cursor: pointer;
    font-size: 0.875rem;
}

.dropdown label:hover {
    color: #3273dc;
}

.dropdown input[type="checkbox"],
.dropdown input[type="radio"] {
    margin-right: 0.5rem;
}

/* ========================================
   TABLE STYLES
   ======================================== */

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-bottom: 2rem;
}

.table th {
    white-space: nowrap;
    vertical-align: middle;
}

.table td {
    vertical-align: middle;
}

/* Title column styling */
.title-cell {
    max-width: 450px;
    min-width: 200px;
    word-wrap: break-word;
}

/* Description column styling */
.description-cell {
    min-width: 200px;
    word-wrap: break-word;
}

/* Agency column styling - no constraint */
.agency-cell {
    word-wrap: break-word;
}

/* Constrained columns - 120px max width */
.region-cell,
.due-date-cell,
.status-cell,
.link-cell {
    max-width: 120px;
    min-width: 80px;
    word-wrap: break-word;
}

.status-cell {
    text-align: center;
}

.truncated-text {
    display: inline;
}

.full-text {
    display: inline;
    word-break: break-word;
}

.description-text {
    display: block;
    /* Use default font styling to match region column */
}

.show-more-link {
    color: #3273dc;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
}

.show-more-link:hover {
    text-decoration: underline;
}

/* Status badge styling */
.tag.is-success {
    background-color: var(--brand-green-bright, #28D792);
}

.tag.is-warning {
    background-color: var(--brand-yellow, #FFED37);
    color: rgba(0,0,0,.7);
}

.tag.is-danger {
    background-color: #f14668;
}

/* Section headers - Pill Style */
.section-header-wrapper {
    margin: 1.5rem 0 1rem 0;
    cursor: pointer;
}

.section-header-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #FFED37;
    color: rgba(0, 0, 0, 0.8);
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    user-select: none;
    width: 100%;
}

.section-header-pill:hover {
    background: #F5E000;
    transform: translateY(-1px);
}

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

/* Empty state styling */
.notification.is-light {
    background-color: #f5f5f5;
    padding: 2rem;
}

.notification .icon.is-large {
    font-size: 3rem;
}

/* Collapsible section styling */
.chevron-icon {
    transition: transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
}

.chevron-icon i {
    font-size: 0.875rem;
}

.section-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Count styling */
#total-count {
    color: #4a4a4a;
    font-size: 0.9em;
}

/* Sortable table header styles */
.sortable-header th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.sortable-header th.sortable:hover {
    background-color: #f8f8f8;
}

.th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sort-icon {
    opacity: 0.3;
    transition: opacity 0.2s ease;
    min-width: 12px;
    text-align: center;
}

.sortable:hover .sort-icon {
    opacity: 0.7;
}

.sortable.active .sort-icon {
    opacity: 1;
    color: #FFED37;
}

.sortable.asc .sort-icon i:before {
    content: "\f0de"; /* fa-sort-up */
}

.sortable.desc .sort-icon i:before {
    content: "\f0dd"; /* fa-sort-down */
}

/* ========================================
   PAGINATION CONTROLS
   ======================================== */

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2rem;
    padding: 1rem 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 1rem;
}

.per-page-selector,
.per-page-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #4a4a4a;
}

.per-page-selector select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.875rem;
}

.per-page-selector select:focus {
    outline: none;
    border-color: #FFED37;
    box-shadow: 0 0 0 2px rgba(255, 237, 55, 0.2);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-nav-btn {
    background: white;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #363636;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
}

.page-nav-btn:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #b5b5b5;
}

.page-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
}

.page-number {
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    color: #363636;
    font-size: 0.875rem;
    font-weight: 500;
}

.page-number:hover {
    background: #f5f5f5;
    border-color: #b5b5b5;
}

.page-number.active {
    background: #FFED37;
    border-color: #FFED37;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.8);
}

.page-number.ellipsis {
    border: none;
    cursor: default;
    background: transparent;
    color: #9a9a9a;
}

.page-number.ellipsis:hover {
    background: transparent;
    border: none;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

/* Responsive Styles */
@media screen and (max-width: 1024px) {
    .proposal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-right {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .search-wrapper {
        width: 100%;
        min-width: auto;
    }
}

@media screen and (max-width: 768px) {
    .action-buttons {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }
    
    .action-btn span:not(.icon) {
        display: none;
    }
    
    .dropdown-menu {
        position: fixed;
        left: 1rem;
        right: 1rem;
        width: auto;
    }
    
    .table th, .table td {
        font-size: 0.875rem;
        padding: 0.5rem;
    }
    
    .table .buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .table .button.is-small {
        font-size: 0.75rem;
    }
    
    .description-cell {
        max-width: 200px;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .pagination-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media screen and (max-width: 480px) {
    /* Hide region and description on mobile */
    .table th:nth-child(3),
    .table td:nth-child(3) {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    /* Hide summary, type, and category columns on mobile */
    .table th:nth-child(3),
    .table td:nth-child(3),
    .table th:nth-child(4),
    .table td:nth-child(4),
    .table th:nth-child(5),
    .table td:nth-child(5) {
        display: none;
    }
}

/* ========================================
   SELECT2 CUSTOM STYLING
   ======================================== */

/* Style Select2 to match Bulma theme */
.dropdown-content .select2-container {
    margin-bottom: 0;
}

.select2-container--classic .select2-selection--single {
    background-color: white;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    height: 2.25em;
    line-height: 1.5;
    padding-left: calc(0.75em - 1px);
    padding-right: calc(0.75em - 1px);
    font-size: 0.875rem;
}

.select2-container--classic .select2-selection--single .select2-selection__rendered {
    color: #363636;
    line-height: 1.5;
    padding-left: 0;
    padding-right: 0;
}

.select2-container--classic .select2-selection--single .select2-selection__arrow {
    height: 2.25em;
    right: 0.75em;
}

.select2-container--classic.select2-container--open .select2-selection--single {
    border-color: #3273dc;
    box-shadow: 0 0 0 0.125em rgba(50, 115, 220, 0.25);
}

.select2-dropdown {
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1);
}

.select2-container--classic .select2-results__option--highlighted[aria-selected] {
    background-color: #3273dc;
    color: white;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    padding: 0.5em 0.75em;
    font-size: 0.875rem;
}

/* Ensure Select2 fits well in the dropdown menu */
.dropdown-item .select2-container {
    width: 100% !important;
}