/* ==================== Promise Grid Styles ==================== */

/* Filter Section */
.promise-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 14px 32px;
    border: 1px solid var(--global-palette3);
    border-radius: 100px;
    background: transparent;
    color: var(--global-palette3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    background: transparent;
    color: var(--global-palette3);
}

.filter-tab.active {
    background: var(--global-palette3);
    color: var(--global-palette8);
}

.filter-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 100px;
    background: var(--global-palette1);
    color: var(--global-palette8);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.filter-btn:hover {
    background: var(--global-palette1);
    color: var(--global-palette8);
    opacity: 0.9;
}

/* Promise Count */
.promise-count {
    margin-bottom: 28px;
}

.count-text {
    line-height: 120% !important;
}

/* Promise Grid */
.promise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 290px);
    gap: 72px 20px;
    justify-content: space-between;
    transition: all 0.3s ease;
}

/* Promise Card */
.promise-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 290px;
    max-width: 290px;
    background: transparent !important;
    transition: all 0.3s ease;
}

.remove-href-underline {
    text-decoration: none;
}

.promise-image {
    width: 100%;
    height: 152px;
    overflow: hidden;
    border-radius: 20px;
    background: #e5e7eb;
}

.promise-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
}

.promise-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Promise Status */
.promise-status {
    padding: 6px 14px;
    border-radius: 100px;
    line-height: 12px;
    letter-spacing: 0.21px;
    text-transform: capitalize;
    color: var(--global-palette8);
    background: var(--global-palette3);
    width: fit-content;
}

.promise-status-kept {
    background: #A3D977;
}

.promise-status-broken {
    background: #F28A8A;
}

.promise-status-stalled {
    background: #89C4F4;
}

.promise-status-in-the-works {
    background: #F7C97E;
}

/* Promise Text */
.promise-title {
    margin: 0 0 12px 0 !important;
}

.promise-excerpt {
    font-weight: 400 !important;
    color: var(--global-palette4);
    letter-spacing: 0.1px !important;
}

.promise-author {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 500;
}

/* Load More Button */
.promise-load-more-wrapper {
    display: flex;
    justify-content: center;
    margin: 40px 0 20px;
}

.promise-load-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 40px;
    min-width: 251px;
    background: transparent !important;
    color: var(--global-palette1);
    border: 2px solid var(--global-palette1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.promise-load-more-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: transparent;
    color: var(--global-palette1);
}

.promise-load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.load-more-spinner svg {
    animation: spin 1s linear infinite;
}

/* Loading States */
.promise-loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid #f3f4f6;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-promises {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
}

/* ==================== Filter Modal Styles ==================== */

.filter-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.filter-modal-content {
    position: relative;
    border-radius: 12px;
    width: 100%;
    max-width: 553px;
    width: 553px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 24px;
    background-color: var(--global-palette8);
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filter-modal-title {
    font-weight: 700 !important;
    font-style: Bold;
    font-size: 24px !important;
    line-height: 120%;
    letter-spacing: -2%;
    color: var(--global-palette3);
    margin: 0 !important;
}

.filter-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.filter-modal-close:hover {
    background: #f3f4f6;
}

.filter-modal-close svg {
    stroke: #6b7280;
}

.filter-modal-body {
    flex: 1;
    overflow-y: auto;
}

/* Filter Sections */
.filter-section {
    border-bottom: 1px solid #e5e7eb;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    box-shadow: none !important;
}

.filter-section-header:hover { 
    background: none;
}

.filter-section-header:focus { 
    background: none;
}

.filter-section-title {
    font-weight: 600;
    font-style: SemiBold;
    font-size: 20px;
    line-height: 120%;
    letter-spacing: -2%;
    color: var(--global-palette4);
}

.filter-section-icon {
    transition: transform 0.3s ease;
    color: var(--global-palette4);
}

.filter-section.active .filter-section-icon {
    transform: rotate(180deg);
}

.filter-section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-section.active .filter-section-content {
    max-height: 500px;
    padding-bottom: 24px;
}

/* Tags Grid */
.filter-tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-tag-pill {
    padding: 12px 24px;
    border: 1px solid var(--global-palette3);
    border-radius: 100px;
    background: var(--global-palette8);
    color: var(--global-palette3);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tag-pill:hover {
    background: var(--global-palette8);
    color: var(--global-palette3);
}

.filter-tag-pill:focus {
    background: var(--global-palette8);
    color: var(--global-palette3);;
}

.filter-tag-pill.active {
    background: var(--global-palette3);
    color: var(--global-palette8);
}

/* Checkboxes */
.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 15px;
    color: var(--global-palette3);
}

.filter-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--global-palette3);
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    transition: all 0.2s;
}

.filter-checkbox:checked {
    background: var(--global-palette3);
    border-color: var(--global-palette3);
}

.filter-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-checkbox:hover {
    border-color: var(--global-palette3);
}

/* Modal Footer */
.filter-modal-footer {
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 20px;
}

.filter-clear-btn {
    font-weight: 500;
    font-style: Medium;
    font-size: 16px;
    line-height: 20px;
    letter-spacing: 0%;
    background: var(--global-palette8);
    color: var(--global-palette3);
    border-radius: 100px;
    padding: 12px 24px;
}

.filter-clear-btn:hover {
    background: var(--global-palette3);
    color: var(--global-palette8);
}

.filter-clear-btn:focus {
    background: var(--global-palette8);
    color: var(--global-palette3);
    box-shadow: none;
}

.filter-done-btn {
    padding: 12px 24px;
    border: 1px solid var(--global-palette3);
    border-radius: 100px;
    background: var(--global-palette3);
    color: var(--global-palette8);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-done-btn:hover {
    background: #111827;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==================== Responsive Design ==================== */

/* Large screens - 4 columns */
@media (min-width: 1200px) {
    .promise-grid {
        grid-template-columns: repeat(4, 290px);
    }
}

/* Medium-large - 3 columns */
@media (min-width: 900px) and (max-width: 1199px) {
    .promise-grid {
        grid-template-columns: repeat(3, 290px);
    }
}

/* Medium - 2 columns */
@media (min-width: 600px) and (max-width: 899px) {
    .promise-grid {
        grid-template-columns: repeat(2, 290px);
    }
}

/* Mobile - single column */
@media (max-width: 599px) {
    .promise-grid {
        grid-template-columns: 1fr;
        gap: 48px 0;
        padding: 0 16px;
    }
    
    .promise-card {
        width: 100%;
        max-width: none;
    }
    
    .filter-modal-content {
        border-radius: 24px 24px 0 0;
        max-height: 95vh;
        margin-top: auto;
    }
    
    .filter-modal-header {
        padding: 24px 20px 20px;
    }
    
    .filter-modal-body {
        padding: 0 20px;
    }
    
    .filter-modal-footer {
        padding: 20px;
        flex-direction: column-reverse;
    }
    
    .filter-clear-btn,
    .filter-done-btn {
        width: 100%;
        text-align: center;
    }
}

/* Tablet and below */
@media (max-width: 768px) {
    .promise-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-actions {
        justify-content: space-between;
    }
    
    .promise-load-more-btn {
        width: 100%;
        max-width: 300px;
    }
}