/* Weekly Needs Page Styles */

.main-weekly-needs {
    padding: 20px;
    background-color: #f5f5f5;
    min-height: calc(100vh - 80px);
}

.page-header {
    color: #000000;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    margin-top: 0;
    border-bottom: none;
    padding-left: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.weekly-needs-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Submit Section */
.submit-section {
    background: #ffffff;
    border-radius: 0;
    padding: 20px 25px;
    box-shadow: none;
    margin-bottom: 20px;
}

.submit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 25px;
}

.submit-section h2 {
    color: #000000;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.requests-counter {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    max-width: 400px;
}

.requests-counter .counter-text {
    font-weight: 500;
    font-size: 13px;
    color: #000000;
    white-space: nowrap;
}

.progress-bar-wrapper {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    min-width: 150px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00FFAA 0%, #00CC88 100%);
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 2px;
}

.progress-bar-container {
    display: none;
}


/* Form Styles */
.need-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* Flow field takes first column on second row */
.form-group.flow-group {
    grid-column: 1 / 2;
}

/* Comment field takes second column on second row */
.form-group.comment-group {
    grid-column: 2 / 3;
    align-self: end;
    position: relative;
}

.form-group.comment-group .form-text {
    position: absolute;
    bottom: -18px;
    left: 0;
    margin: 0;
}

/* LP preview and submit button span columns 3-4 on second row */
.form-group.lp-preview-group {
    grid-column: 3 / 5;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
}

.lp-preview-content {
    display: flex;
    flex-direction: column;
}

.submit-button-wrapper {
    align-self: end;
    padding-bottom: 0;
}

.form-group label {
    color: #000000;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.required {
    color: #ff4444;
}

.form-control {
    background: #ffffff;
    border: none;
    border-bottom: 1px solid #ccc;
    border-radius: 0;
    color: #000000;
    padding: 8px 15px;
    font-size: 15px;
    height: 45px;
    transition: all 0.2s ease;
    box-shadow: none;
}

.form-control:focus {
    background: #ffffff;
    border-color: #00FFAA;
    outline: none;
    box-shadow: none;
}

.form-control::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.input-with-currency .form-control {
    padding-left: 25px !important;
    border-bottom: 1px solid #ccc;
    box-shadow: none;
}

.input-with-currency .form-control:focus {
    border-bottom-color: #00FFAA;
    box-shadow: none;
}

.input-with-icon .form-control {
    padding-left: 25px !important;
    padding-right: 80px;
    border-bottom: 1px solid #ccc;
    width: 100%;
    box-shadow: none;
}

.input-with-icon .form-control:focus {
    border-bottom-color: #00FFAA;
    box-shadow: none;
}

.field-helper {
    font-size: 9px;
    color: #999999;
    margin-top: 3px;
    display: block;
    min-height: 12px;
}

.field-error {
    font-size: 11px;
    color: #ff4444;
    margin-top: 3px;
    display: block;
    min-height: 14px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.field-error.show {
    opacity: 1;
}

.input-with-currency {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #00FFAA;
    font-weight: 600;
    font-size: 14px;
    z-index: 1;
    pointer-events: none;
}

/* LP Preview Options */
.lp-preview-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 0;
}

.lp-input-container {
    flex: 1;
    position: relative;
}

.lp-option {
    flex: 1;
}

.lp-divider {
    color: #999999;
    font-size: 10px;
    font-weight: 600;
    padding: 0 8px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999999;
    font-size: 14px;
    z-index: 1;
    pointer-events: none;
}

.btn-preview-url {
    position: absolute;
    right: 44px;
    background: rgba(0, 255, 170, 0.1);
    border: none;
    border-radius: 3px;
    color: #00FFAA;
    padding: 5px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.btn-preview-url:hover {
    background: rgba(0, 255, 170, 0.2);
}

.btn-upload-inline {
    position: absolute;
    right: 4px;
    background: transparent;
    border: none;
    color: #999999;
    padding: 5px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 34px;
    width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 3px;
}

.btn-upload-inline:hover {
    background: rgba(0, 255, 170, 0.1);
    color: #00FFAA;
}

.preview-thumbnail {
    position: relative;
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    background: #f5f5f5;
}

.preview-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-thumbnail {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff4444;
    border: none;
    border-radius: 50%;
    color: #ffffff;
    width: 18px;
    height: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 9px;
    padding: 0;
    line-height: 1;
}

.btn-remove-thumbnail:hover {
    background: #ff0000;
    transform: scale(1.1);
}

.btn-submit {
    background: #00FFAA;
    border: 2px solid #00FFAA;
    border-radius: 20px;
    color: #000000;
    padding: 5px 20px;
    padding-top: 7px;
    font-size: 13px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 45px;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 0;
    white-space: nowrap;
    box-shadow: none;
}

.btn-submit:hover {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
    box-shadow: none;
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    background: #cccccc;
    border-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-submit i {
    font-size: 13px;
}


/* Requests Section */
.requests-section {
    background: #ffffff;
    border-radius: 0;
    padding: 25px 30px;
    box-shadow: none;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e0e0e0 50%, transparent 100%);
    margin: 20px 0;
}

.requests-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.header-right {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 250px;
}

.search-icon {
    position: absolute;
    left: 0;
    color: #999999;
    font-size: 14px;
}

.search-input {
    padding: 8px 14px 8px 28px;
    border: none;
    border-bottom: 1px solid #ccc;
    border-radius: 0;
    font-size: 13px;
    width: 100%;
    transition: all 0.2s ease;
    background: transparent;
    height: 36px;
}

.search-input:focus {
    outline: none;
    border-color: #00FFAA;
    box-shadow: none;
}

.search-input::placeholder {
    color: #999999;
}

/* Segmented Control Styles */
.filter-tabs-segmented {
    display: inline-flex;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 4px;
    gap: 0;
}

.filter-tab-seg {
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #666666;
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.filter-tab-seg:hover {
    color: #333333;
}

.filter-tab-seg.active {
    background: #00FFAA;
    color: #000000;
    box-shadow: 0 2px 4px rgba(0, 255, 170, 0.2);
}

.filter-dropdown {
    min-width: 150px;
}

.filter-dropdown select {
    min-width: 150px;
    height: 36px;
    font-size: 13px;
    border: none;
    border-bottom: 1px solid #ccc;
    border-radius: 0;
    background: transparent;
    padding: 8px 30px 8px 0;
    color: #000000;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-dropdown select:focus {
    outline: none;
    border-color: #00FFAA;
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-action {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #666666;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: 36px;
    border-radius: 0;
}

.btn-action:hover {
    background: transparent;
    border-bottom-color: #00FFAA;
    color: #00FFAA;
}

.btn-action-text {
    width: auto;
    gap: 6px;
    padding: 8px 0;
}

.btn-action-label {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.requests-section h3 {
    color: #000000;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    margin-top: 0;
}

/* Table Styles */
.requests-table-container {
    overflow-x: auto;
    border-radius: 0;
    background: #ffffff;
    border: none;
    width: 100%;
}

.requests-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
    margin-top: 0;
}

.requests-table thead {
    background: #f9f9f9;
}

.requests-table th {
    color: #666666;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 15px;
    text-align: center;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.requests-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.requests-table th.sortable:hover {
    background: #f0f0f0;
    color: #00FFAA;
}

.sort-icon {
    margin-left: 5px;
    font-size: 10px;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.requests-table th.sortable:hover .sort-icon {
    opacity: 1;
}

.requests-table th.sorted-asc .sort-icon::before {
    content: "\f0de";
    opacity: 1;
}

.requests-table th.sorted-desc .sort-icon::before {
    content: "\f0dd";
    opacity: 1;
}

.requests-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.requests-table tbody tr:hover {
    background: #fafafa;
}

.requests-table td {
    color: #333333;
    font-size: 13px;
    padding: 14px 15px;
    text-align: center;
}

.requests-table td:first-child {
    color: #999999;
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.pending {
    background: #FFA500;
    color: #ffffff;
}

.status-badge.matched {
    background: #00FFAA;
    color: #000000;
}

.status-badge.cancelled {
    background: #EE6A6A;
    color: #ffffff;
}

.status-badge.inreview {
    background: #87CEEB;
    color: #ffffff;
}

.status-badge.expired {
    background: #999999;
    color: #ffffff;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #999999;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    border-radius: 3px;
}

.icon-btn:hover {
    background: #f5f5f5;
}

.preview-icon:hover {
    color: #00FFAA;
    transform: scale(1.15);
}

/* Flag Icons */
.fi {
    width: 18px;
    height: 13px;
    display: inline-block;
    margin-right: 8px;
    border-radius: 2px;
    vertical-align: middle;
}


/* Responsive Design */
@media (max-width: 1200px) {
    .requests-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-tabs,
    .action-buttons {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .submit-section,
    .requests-section {
        padding: 20px;
    }
    
    .submit-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .requests-counter {
        width: 100%;
        max-width: 100%;
    }
    
    .need-form {
        grid-template-columns: 1fr;
    }
    
    .form-group.flow-group {
        grid-column: 1;
    }
    
    .btn-submit {
        width: 100%;
    }
    
    .filter-tabs {
        flex-wrap: wrap;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-action {
        width: 100%;
        justify-content: center;
    }
}

/* Select2 Overrides for Light Theme in Form */
.weekly-needs-container .select2-container {
    border-bottom: 1px solid #ccc !important;
}

.weekly-needs-container .select2-container--default .select2-selection--single {
    background: #ffffff;
    border: none !important;
    border-radius: 0 !important;
    height: 45px !important;
}

.weekly-needs-container .custom-container {
    border: none !important;
    border-radius: 0 !important;
    height: 45px !important;
    font-size: 15px;
    padding-left: 15px !important;
    line-height: 35px;
    background: #ffffff;
}

.weekly-needs-container .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #B2B2B2 !important;
    line-height: 45px !important;
    padding-left: 15px;
    font-size: 15px;
    padding: 0 !important;
    margin-top: 0;
    position: relative;
}

/* Selected value styling - darker color */
.weekly-needs-container .select2-container--default .select2-selection--single .select2-selection__rendered:not([title=""]):not(.select2-selection__placeholder) {
    color: #000000 !important;
}

/* Placeholder styling when no value selected */
.weekly-needs-container .select2-container--default .select2-selection--single .select2-selection__rendered[title=""],
.weekly-needs-container .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #B2B2B2 !important;
    opacity: 1;
}

.weekly-needs-container .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 35px;
}

.weekly-needs-container .select-arrow {
    top: 10px !important;
    right: 10px !important;
    font-size: 24px !important;
    color: #ccc !important;
    position: absolute;
}

.weekly-needs-container .select2-dropdown {
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 0;
    margin-top: -1px;
    box-shadow: 0px 3px 10px 2px rgba(34, 36, 38, 0.15);
}

.weekly-needs-container .select2-container--default .select2-results__option {
    color: #B2B2B2 !important;
    padding: 6px 15px !important;
    font-size: 15px;
    background-color: transparent !important;
}

.weekly-needs-container .select2-container--default .select2-results__option:hover {
    background-color: transparent !important;
    color: #525252 !important;
}

.weekly-needs-container .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: transparent !important;
    color: #525252 !important;
}

.weekly-needs-container .select2-container--default .select2-search--dropdown .select2-search__field {
    background: #ffffff;
    border: none !important;
    border-bottom: 1px solid #ccc !important;
    color: #000000;
    padding-left: 15px !important;
    height: 45px !important;
    font-size: 15px;
    outline: none !important;
}

.weekly-needs-container .select2-search {
    padding: 0 !important;
}

.weekly-needs-container .select2-search__field::placeholder {
    color: #999999;
    opacity: 1;
}

.weekly-needs-container .select2-search__field:-ms-input-placeholder {
    color: #999999;
}

.weekly-needs-container .select2-search__field::-ms-input-placeholder {
    color: #999999;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999999;
}

.empty-icon {
    font-size: 64px;
    color: #d0d0d0;
    margin-bottom: 20px;
}

.empty-state h4 {
    font-size: 20px;
    color: #666666;
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-state p {
    font-size: 15px;
    color: #999999;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Preview Hover Tooltip */
.preview-tooltip {
    position: fixed;
    z-index: 10000;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    padding: 8px;
    width: 320px;
    pointer-events: none;
    animation: tooltipFadeIn 0.15s ease;
}

.preview-tooltip img {
    width: 100%;
    border-radius: 4px;
    display: block;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.preview-icon {
    text-decoration: none;
    color: inherit;
}

/* Tooltips */
[title] {
    position: relative;
}

/* Field validation states */
.form-group.has-error .form-control {
    border-color: #ff4444;
}

.form-group.has-error label {
    color: #ff4444;
}

.form-group.has-success .form-control {
    border-color: #00FFAA;
}

/* Loading state */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-submit.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #000000;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments for new features */
@media (max-width: 1200px) {
    .requests-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-input {
        width: 150px;
    }
}

@media (max-width: 768px) {
    .lp-preview-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .lp-divider {
        padding: 5px 0;
    }
    
    .header-right {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        width: 100%;
    }
    
    .filter-dropdown {
        width: 100%;
    }
    
    .filter-dropdown select {
        width: 100%;
    }
    
    .action-icons {
        justify-content: center;
    }
    
    .requests-section {
        margin-top: 20px;
    }
}

/* Success Notification */
.success-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #00FFAA;
    color: #000000;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 255, 170, 0.3);
    font-size: 15px;
    font-weight: 600;
    z-index: 10001;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.success-notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Additional status badge colors */
.status-badge {
    position: relative;
}

/* Hover effects for table rows */
.requests-table tbody tr {
    transition: all 0.2s ease;
}

.requests-table tbody tr:hover {
    background: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Smooth transitions for all interactive elements */
.filter-tab,
.btn-action,
.icon-btn,
.btn-submit,
.btn-upload,
.btn-preview-url {
    transition: all 0.2s ease;
}

/* Focus states for accessibility */
.form-control:focus,
.search-input:focus {
    outline: none;
    border-color: #00FFAA;
    box-shadow: 0 0 0 2px rgba(0, 255, 170, 0.1);
}

button:focus {
    outline: 2px solid #00FFAA;
    outline-offset: 2px;
}

/* Disabled state for submit button when limit reached */
.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Disabled form state when weekly limit reached */
.form-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.form-disabled .select2-container .select2-selection {
    background-color: #e9ecef;
}

/* Animation for refresh button */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Comment Field Styles */
.form-group input.form-control,
.form-group textarea.form-control {
    font-family: inherit;
    font-size: 13px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 0;
    transition: border-color 0.2s;
}

.form-group textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-group input.form-control:focus,
.form-group textarea.form-control:focus {
    border-color: #00FFAA;
    outline: none;
    box-shadow: none;
}

.form-group .form-text {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #000;
    margin-bottom: 8px;
}

.navbar-collapse.collapse.hidden-xs.format-high {
    display: block !important;
}