/**
 * SRA Collab Crowdfunding Styles
 *
 * @package    SRA_Collab
 * @subpackage SRA_Collab/public/css
 * @since      1.8.0
 */

/* ==========================================================================
   Crowdfunding Card Footer
   ========================================================================== */

.sra-announcement-card.sra-financing-call {
    border-left: 4px solid var(--sra-status-color, #e00000);
}

.sra-crowdfunding-footer {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 0 0 8px 8px;
    margin: 15px -15px -15px;
}

.sra-cf-progress-section {
    margin-bottom: 12px;
}

.sra-cf-progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    position: relative;
}

.sra-cf-progress-bar-fill {
    background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease-out;
    position: relative;
}

.sra-cf-progress-bar-fill.last-mile {
    background: linear-gradient(90deg, #ff9800 0%, #ffc107 100%);
}

.sra-cf-progress-bar-fill.completed {
    background: linear-gradient(90deg, #4caf50 0%, #2e7d32 100%);
}

/* Optimal target marker */
.sra-cf-optimal-marker {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: #666;
    opacity: 0.5;
}

.sra-cf-stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.85em;
    color: #555;
}

.sra-cf-amount {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
}

.sra-cf-supporters {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sra-cf-supporters svg {
    width: 16px;
    height: 16px;
    fill: #666;
}

.sra-cf-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sra-cf-status-badge.status-new {
    background: #e0e0e0;
    color: #666;
}

.sra-cf-status-badge.status-running {
    background: #ffebee;
    color: #c62828;
}

.sra-cf-status-badge.status-last_mile {
    background: #fff3e0;
    color: #e65100;
}

.sra-cf-status-badge.status-completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.sra-cf-status-badge.status-archived {
    background: #f5f5f5;
    color: #9e9e9e;
}

/* ==========================================================================
   Single Financing Call Page
   ========================================================================== */

.sra-financing-call-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    margin: 30px 0;
}

@media (max-width: 991px) {
    .sra-financing-call-layout {
        grid-template-columns: 1fr;
    }
    
    .sra-financing-call-sidebar {
        order: -1;
    }
}

/* Main Content Area */
.sra-financing-call-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}

.sra-fc-header {
    padding: 30px;
    border-bottom: 1px solid #eee;
}

.sra-fc-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8em;
    font-weight: 600;
    margin: 0 0 15px;
    color: #333;
}

.sra-fc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9em;
    color: #666;
}

.sra-fc-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sra-fc-meta-item svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Content Sections */
.sra-fc-sections {
    padding: 30px;
}

.sra-fc-section {
    margin-bottom: 30px;
}

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

.sra-fc-section h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e00000;
    display: inline-block;
}

.sra-fc-section-content {
    font-size: 0.95em;
    line-height: 1.7;
    color: #444;
}

.sra-fc-section-content p {
    margin: 0 0 15px;
}

.sra-fc-section-content p:last-child {
    margin-bottom: 0;
}

/* Sidebar */
.sra-financing-call-sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.sra-fc-funding-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}

.sra-fc-funding-header {
    background: linear-gradient(135deg, #e00000 0%, #b71c1c 100%);
    color: #fff;
    padding: 20px;
    text-align: center;
}

.sra-fc-funding-status {
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.sra-fc-funding-amount {
    font-size: 2.2em;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
}

.sra-fc-funding-target {
    font-size: 0.9em;
    opacity: 0.85;
    margin-top: 5px;
}

.sra-fc-funding-body {
    padding: 20px;
}

/* Progress Bar (Sidebar) */
.sra-fc-progress {
    margin-bottom: 20px;
}

.sra-fc-progress-bar-large {
    background: #e0e0e0;
    border-radius: 15px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

.sra-fc-progress-fill {
    height: 100%;
    border-radius: 15px;
    transition: width 0.5s ease-out;
    background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    min-width: 40px;
}

.sra-fc-progress-fill.last-mile {
    background: linear-gradient(90deg, #ff9800 0%, #ffc107 100%);
}

.sra-fc-progress-fill.completed {
    background: linear-gradient(90deg, #4caf50 0%, #2e7d32 100%);
}

.sra-fc-progress-text {
    font-size: 0.75em;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.sra-fc-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #666;
}

/* Stats Grid */
.sra-fc-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.sra-fc-stat {
    text-align: center;
    padding: 15px 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.sra-fc-stat-value {
    font-size: 1.4em;
    font-weight: 700;
    color: #333;
    font-family: 'Poppins', sans-serif;
}

.sra-fc-stat-label {
    font-size: 0.75em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 3px;
}

/* Pledge Section */
.sra-fc-pledge-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.sra-fc-pledge-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px;
    text-align: center;
}

.sra-fc-pledge-amounts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.sra-fc-pledge-btn {
    padding: 10px 5px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    font-size: 0.85em;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sra-fc-pledge-btn:hover {
    border-color: #e00000;
    color: #e00000;
}

.sra-fc-pledge-btn.selected {
    border-color: #e00000;
    background: #e00000;
    color: #fff;
}

/* Custom Amount Input */
.sra-fc-custom-amount {
    margin-bottom: 15px;
}

.sra-fc-custom-amount-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 8px;
    display: block;
}

.sra-fc-custom-amount-input {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.sra-fc-custom-amount-input:focus-within {
    border-color: #e00000;
}

.sra-fc-currency-label {
    padding: 10px 12px;
    background: #f5f5f5;
    font-weight: 600;
    color: #666;
    font-size: 0.9em;
}

.sra-fc-custom-amount-input input {
    flex: 1;
    border: none;
    padding: 10px 12px;
    font-size: 1em;
    outline: none;
}

/* Submit Pledge Button */
.sra-fc-submit-pledge {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #e00000 0%, #b71c1c 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sra-fc-submit-pledge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(224, 0, 0, 0.3);
}

.sra-fc-submit-pledge:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sra-fc-submit-pledge svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Closed/Completed State */
.sra-fc-funding-closed {
    text-align: center;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.sra-fc-funding-closed p {
    margin: 0;
    color: #666;
}

/* Info Note */
.sra-fc-info-note {
    margin-top: 15px;
    padding: 12px;
    background: #e3f2fd;
    border-radius: 8px;
    font-size: 0.8em;
    color: #1565c0;
    text-align: center;
    line-height: 1.5;
}

.sra-fc-info-note svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    vertical-align: middle;
    margin-right: 5px;
}

/* ==========================================================================
   Supporters List
   ========================================================================== */

.sra-fc-supporters {
    margin-top: 20px;
}

.sra-fc-supporters-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}

.sra-fc-supporters-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sra-fc-supporters-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.sra-fc-supporters-count {
    font-size: 0.85em;
    color: #666;
}

.sra-fc-supporters-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}

.sra-fc-supporter-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.sra-fc-supporter-item:last-child {
    border-bottom: none;
}

.sra-fc-supporter-item:hover {
    background: #f8f9fa;
}

/* Ranking badges */
.sra-fc-supporter-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    font-weight: 700;
    margin-right: 12px;
    background: #e0e0e0;
    color: #666;
}

.sra-fc-supporter-rank.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
    color: #7a5c00;
}

.sra-fc-supporter-rank.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    color: #555;
}

.sra-fc-supporter-rank.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #a66628 100%);
    color: #fff;
}

.sra-fc-supporter-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.sra-fc-supporter-info {
    flex: 1;
}

.sra-fc-supporter-name {
    font-weight: 500;
    color: #333;
    font-size: 0.95em;
}

.sra-fc-supporter-date {
    font-size: 0.75em;
    color: #999;
    margin-top: 2px;
}

.sra-fc-supporter-amount {
    font-weight: 600;
    color: #4caf50;
    font-family: 'Poppins', sans-serif;
}

/* Show More Link */
.sra-fc-supporters-more {
    display: block;
    text-align: center;
    padding: 12px;
    color: #e00000;
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
    border-top: 1px solid #eee;
    transition: background 0.2s ease;
}

.sra-fc-supporters-more:hover {
    background: #fafafa;
    color: #b71c1c;
}

/* ==========================================================================
   Author Controls (Delete/Edit buttons)
   ========================================================================== */

.sra-fc-author-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.sra-fc-author-btn {
    flex: 1;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sra-fc-author-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.sra-fc-author-btn.btn-edit {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.sra-fc-author-btn.btn-edit:hover {
    background: #eee;
}

.sra-fc-author-btn.btn-delete {
    background: #fff5f5;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.sra-fc-author-btn.btn-delete:hover {
    background: #ffebee;
}

/* Status Change Dropdown */
.sra-fc-status-control {
    margin-top: 15px;
}

.sra-fc-status-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    background: #fff;
}

.sra-fc-status-select:focus {
    border-color: #e00000;
    outline: none;
}

/* ==========================================================================
   Pledge Modal
   ========================================================================== */

.sra-cf-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sra-cf-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sra-cf-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.sra-cf-modal-overlay.active .sra-cf-modal {
    transform: scale(1);
}

.sra-cf-modal-header {
    padding: 20px;
    background: linear-gradient(135deg, #e00000 0%, #b71c1c 100%);
    color: #fff;
    text-align: center;
}

.sra-cf-modal-header h3 {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.2em;
    font-weight: 600;
}

.sra-cf-modal-body {
    padding: 25px;
}

.sra-cf-modal-amount-display {
    text-align: center;
    margin-bottom: 20px;
}

.sra-cf-modal-amount {
    font-size: 2.5em;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: #e00000;
}

.sra-cf-modal-note {
    padding: 15px;
    background: #fff3e0;
    border-radius: 8px;
    font-size: 0.85em;
    color: #e65100;
    margin-bottom: 20px;
    line-height: 1.5;
}

.sra-cf-modal-actions {
    display: flex;
    gap: 10px;
}

.sra-cf-modal-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sra-cf-modal-btn.btn-cancel {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #666;
}

.sra-cf-modal-btn.btn-cancel:hover {
    background: #eee;
}

.sra-cf-modal-btn.btn-confirm {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    border: none;
    color: #fff;
}

.sra-cf-modal-btn.btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.sra-cf-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 767px) {
    .sra-fc-funding-amount {
        font-size: 1.8em;
    }
    
    .sra-fc-pledge-amounts {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sra-fc-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .sra-fc-author-controls {
        flex-direction: column;
    }
    
    .sra-financing-call-layout {
        gap: 20px;
    }
}

/* ==========================================================================
   Loading States & Animations
   ========================================================================== */

.sra-cf-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: sra-cf-spin 0.8s linear infinite;
}

@keyframes sra-cf-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Progress bar animation */
@keyframes sra-cf-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.sra-fc-progress-fill.last-mile {
    animation: sra-cf-pulse 1.5s ease-in-out infinite;
}

/* Success message */
.sra-cf-success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sra-cf-success-message svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Error message */
.sra-cf-error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 15px;
}
