/* Yearly Project Widget - Modern Collapsible Styling */

.home-project-widget {
    --widget-radius: 1rem;
    background-color: var(--surface-1, #ffffff);
    border-radius: var(--widget-radius);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.home-project-widget:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.12);
}

/* Project Header */
.project-header {
    position: relative;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--bs-primary, #0d6efd), var(--bs-purple, #6f42c1));
    color: white;
    overflow: hidden;
}

.project-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.project-logo {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    padding: 0.25rem;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
}

.project-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.project-title-area {
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.project-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Header Controls */
.project-header-controls {
    position: relative;
    z-index: 1;
}

.project-toggle {
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.project-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.project-toggle:hover::before {
    left: 100%;
}

.project-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: white !important;
    transform: translateY(-1px);
}

.project-toggle .toggle-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 0.5rem;
}

.project-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.project-toggle[aria-expanded="true"] .toggle-text::after {
    content: " Less";
}

/* Project Summary (Always Visible) */
.project-summary {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.summary-stat {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.summary-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin-bottom: 0.25rem;
}

.summary-label {
    font-size: 0.75rem;
    color: var(--text-secondary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-weight: 500;
}

.summary-progress {
    margin-top: 1rem;
}

/* Section Divider */
.section-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0 1rem 0;
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
}

.divider-text {
    background: white;
    padding: 0 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary, #64748b);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Project Body (Collapsible Content) */
.project-body {
    padding: 1.5rem;
    background: white;
}

.project-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1rem;
    background-color: var(--surface-2, #f8fafc);
    border-radius: 0.75rem;
    text-align: center;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.project-amount {
    grid-column: span 2;
    border-left-color: var(--bs-success, #198754);
}

.project-contributors {
    border-left-color: var(--bs-primary, #0d6efd);
}

.project-time {
    border-left-color: var(--bs-warning, #ffc107);
}

.project-your-contribution {
    grid-column: span 2;
    border-left-color: var(--bs-purple, #6f42c1);
    position: relative;
    overflow: hidden;
}

.project-your-contribution::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(111, 66, 193, 0.1) 0%, transparent 70%);
    z-index: 0;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0.5;
    }
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    position: relative;
    z-index: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.project-rank {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--bs-purple, #6f42c1);
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

/* Progress Styling */
.progress-container {
    margin-bottom: 1.5rem;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.progress-current {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.progress-target {
    color: var(--text-secondary, #64748b);
}

.progress-bar-container {
    height: 0.6rem;
    background-color: var(--surface-2, #f1f5f9);
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bs-primary, #0d6efd), var(--bs-purple, #6f42c1));
    border-radius: 1rem;
    transition: width 0.6s ease-out;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* CTA Button */
.project-cta {
    display: block;
    width: 100%;
    padding: 0.875rem;
    text-align: center;
    background: linear-gradient(135deg, var(--bs-primary, #0d6efd), var(--bs-purple, #6f42c1));
    color: white !important;
    text-decoration: none;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.project-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.project-cta:hover::before {
    left: 100%;
}

.project-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white !important;
}

.project-cta:active {
    transform: translateY(0);
}

/* Collapsible Animations */
.collapse {
    transition: all 0.3s ease-in-out;
}

.collapsing {
    transition: height 0.3s ease-in-out;
}

/* Animation for expanding/collapsing */
.collapse.show .stat-card {
    animation: slideIn 0.3s ease-out;
    animation-fill-mode: both;
}

.collapse.show .stat-card:nth-child(1) {
    animation-delay: 0.05s;
}

.collapse.show .stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.collapse.show .stat-card:nth-child(3) {
    animation-delay: 0.15s;
}

.collapse.show .stat-card:nth-child(4) {
    animation-delay: 0.2s;
}

/* Dark Mode Support */
[data-bs-theme="dark"] {
    .home-project-widget {
        background-color: #0f172a;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .project-summary {
        background: linear-gradient(135deg, #1e293b, #334155);
    }

    .summary-stat {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .summary-value {
        color: #e2e8f0;
    }

    .summary-label {
        color: #94a3b8;
    }

    .project-body {
        background: #0f172a;
    }

    .stat-card {
        background-color: #1e293b;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .stat-value {
        color: #e2e8f0;
    }

    .stat-label {
        color: #94a3b8;
    }

    .progress-current {
        color: #e2e8f0;
    }

    .progress-target {
        color: #94a3b8;
    }

    .progress-bar-container {
        background-color: #334155;
    }

    .divider-text {
        background: #0f172a;
        color: #94a3b8;
    }

    .section-divider::before {
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .project-header {
        padding: 1.25rem;
        flex-wrap: wrap;
    }

    .project-title {
        font-size: 1.1rem;
    }

    .project-subtitle {
        font-size: 0.8rem;
    }

    .project-summary {
        padding: 1rem 1.25rem;
    }

    .summary-stats {
        gap: 0.75rem;
    }

    .summary-value {
        font-size: 1rem;
    }

    .summary-label {
        font-size: 0.7rem;
    }

    .project-body {
        padding: 1.25rem;
    }

    .project-stats {
        gap: 0.75rem;
    }
}

@media (max-width: 576px) {
    .project-header {
        padding: 1rem;
    }

    .project-logo {
        width: 50px;
        height: 50px;
    }

    .project-title {
        font-size: 1rem;
    }

    .summary-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .summary-stat {
        padding: 0.5rem;
    }

    .project-stats {
        grid-template-columns: 1fr;
    }

    .project-amount,
    .project-your-contribution {
        grid-column: span 1;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .project-toggle .toggle-text {
        display: none !important;
    }
}