/* ==================================================================
   MOBILE DONATION GOALS - ONE LINE DESIGN (CLEAN VERSION)
   Professional horizontal layout for mobile devices with proper color handling
   Version: 2.0 - Clean Rewrite
================================================================== */

/* ==================================================================
   MOBILE ONE-LINE DONATION GOALS (768px and below)
================================================================== */

@media (max-width: 768px) {
    
    /* Main donation goal tracker container */
    .donation-goal-tracker-v2 {
        position: relative;
        margin-bottom: 1.5rem;
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(5, 150, 105, 0.05));
        border: 2px solid rgba(16, 185, 129, 0.15);
        border-radius: 12px;
        padding: 1rem;
        backdrop-filter: blur(15px);
        box-shadow: 
            0 4px 20px rgba(0, 0, 0, 0.08),
            0 1px 4px rgba(16, 185, 129, 0.1);
        overflow: hidden;
    }
    
    /* Top accent border */
    .donation-goal-tracker-v2::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #10b981, #059669, #047857, #065f46);
        border-radius: 12px 12px 0 0;
    }
    
    /* Widgets container - horizontal layout */
    .goal-v2-widgets {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        flex-wrap: nowrap;
        margin-bottom: 0.75rem;
    }
    
    /* Individual widget styling */
    .goal-v2-widget {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        min-width: 0;
        padding: 0.75rem 0.25rem;
        background: rgba(255, 255, 255, 0.7);
        border-radius: 8px;
        border: 1px solid rgba(16, 185, 129, 0.1);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .goal-v2-widget:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        background: rgba(255, 255, 255, 0.9);
    }
    
    /* Widget content layout */
    .widget-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        width: 100%;
    }
    
    .widget-info {
        text-align: center;
        min-width: 0;
        width: 100%;
    }
    
    /* Widget icons */
    .widget-icon {
        width: 1.75rem;
        height: 1.75rem;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem;
        color: #059669;
        background: rgba(16, 185, 129, 0.1);
        margin-bottom: 0.25rem;
    }
    
    /* Widget values and labels */
    .widget-value {
        font-size: 1rem;
        font-weight: 700;
        color: #059669;
        line-height: 1.2;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .widget-label {
        font-size: 0.7rem;
        color: #6b7280;
        font-weight: 500;
        line-height: 1.2;
        margin-top: 0.125rem;
        opacity: 0.8;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Progress section - takes more space */
    .goal-v2-widget-progress {
        flex: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.75rem 0.5rem;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 8px;
        border: 1px solid rgba(16, 185, 129, 0.1);
        min-width: 0;
    }
    
    /* Progress container */
    .progress-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        width: 100%;
    }
    
    /* Progress bar container - CLEAN COLOR HANDLING */
    .progress-bar-container {
        width: 100%;
        height: 6px;
        background: #e5e7eb; /* Light gray for unfilled portion */
        border-radius: 3px;
        overflow: hidden;
        position: relative;
        box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    }
    
    /* Progress bar - GREEN for filled portion */
    .progress-bar {
        height: 100%;
        background: linear-gradient(90deg, #10b981, #059669); /* Green gradient */
        border-radius: 3px;
        transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        min-width: 0;
    }
    
    /* EMPTY STATE HANDLING - When progress is 0% */
    .progress-bar-container.empty-state {
        background: #9ca3af; /* Darker gray when completely empty */
    }
    
    .progress-bar-container.empty-state .progress-bar {
        width: 0%;
        opacity: 0;
        transition: width 0.3s ease, opacity 0.3s ease;
    }
    
    /* Progress bar shine effect */
    .progress-bar::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, 
            transparent 25%, 
            rgba(255, 255, 255, 0.1) 25%, 
            rgba(255, 255, 255, 0.1) 50%, 
            transparent 50%, 
            transparent 75%, 
            rgba(255, 255, 255, 0.1) 75%);
        background-size: 8px 8px;
        animation: progressShine 1.5s linear infinite;
    }
    
    @keyframes progressShine {
        0% { background-position: -8px 0; }
        100% { background-position: 8px 0; }
    }
    
    /* Progress info layout */
    .progress-info {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 0.25rem;
    }
    
    /* Progress percentage */
    .progress-percentage {
        font-size: 1rem;
        font-weight: 700;
        color: #059669;
        margin: 0;
        white-space: nowrap;
    }
    
    /* Progress label and goal amount */
    .progress-label {
        font-size: 0.7rem;
        color: #6b7280;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .progress-goal-amount {
        font-size: 0.8rem;
        color: #374151;
        font-weight: 600;
        white-space: nowrap;
    }
    
    /* Campaign title styling - FIX FOR BROKEN TITLES */
    .campaign-title,
    .goal-title,
    h3.campaign-title {
        font-size: 1rem;
        font-weight: 600;
        color: #1f2937;
        line-height: 1.3;
        margin: 0 0 0.5rem 0;
        text-align: center;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* Last updated info */
    .last-updated {
        position: static;
        text-align: center;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(16, 185, 129, 0.1);
        font-size: 0.65rem;
        color: #9ca3af;
        font-style: italic;
    }
}

/* ==================================================================
   SMALL MOBILE OPTIMIZATION (480px and below)
================================================================== */

@media (max-width: 480px) {
    
    .donation-goal-tracker-v2 {
        padding: 0.875rem;
        margin-bottom: 1.25rem;
        border-radius: 10px;
    }
    
    .goal-v2-widgets {
        gap: 0.375rem;
    }
    
    .goal-v2-widget {
        padding: 0.625rem 0.25rem;
    }
    
    .widget-icon {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.75rem;
    }
    
    .widget-value {
        font-size: 0.875rem;
    }
    
    .widget-label {
        font-size: 0.625rem;
    }
    
    .goal-v2-widget-progress {
        padding: 0.625rem 0.375rem;
    }
    
    .progress-bar-container {
        height: 5px;
        background: #e5e7eb; /* Light gray for unfilled portion */
    }
    
    .progress-bar-container.empty-state {
        background: #9ca3af; /* Darker gray when completely empty */
    }
    
    .progress-percentage {
        font-size: 0.875rem;
    }
    
    .progress-label {
        font-size: 0.625rem;
    }
    
    .progress-goal-amount {
        font-size: 0.75rem;
    }
    
    .campaign-title,
    .goal-title,
    h3.campaign-title {
        font-size: 0.875rem;
    }
    
    .last-updated {
        font-size: 0.6rem;
        margin-top: 0.625rem;
        padding-top: 0.625rem;
    }
}