/**
 * Calculation Progress Bar Styles
 * Floating panel showing 3-step Green Date calculation process
 */

.calc-progress-container {
    position: fixed;
    top: 160px;
    right: 20px;
    width: 480px;
    max-height: calc(100vh - 180px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: slideInRight 0.4s ease-out;
}

.calc-progress-container.hidden {
    display: none;
}

@keyframes slideInRight {
    from {
        transform: translateX(520px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Header */
.calc-progress-header {
    background: linear-gradient(135deg, #2d5016 0%, #4a7c2c 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #73a942;
}

.calc-progress-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.calc-icon {
    font-size: 24px;
}

.calc-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calc-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Body */
.calc-progress-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

/* Step Container */
.calc-step {
    background: white;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.calc-step:last-child {
    margin-bottom: 0;
}

.calc-step-header {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
}

/* Step Number/Icon */
.calc-step-number {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.calc-step-number.pending {
    background: #e0e0e0;
    color: #888;
}

.calc-step-number.running {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    animation: pulse 1.5s ease-in-out infinite;
}

.calc-step-number.completed {
    background: linear-gradient(135deg, #4a7c2c 0%, #73a942 100%);
    color: white;
}

.calc-step-number.error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(74, 144, 226, 0);
    }
}

.step-icon {
    font-size: 24px;
}

.calc-step-number.running .step-icon {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Step Info */
.calc-step-info {
    flex: 1;
}

.calc-step-title {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.calc-step-description {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Status Badge */
.calc-step-status {
    display: flex;
    align-items: flex-start;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.pending {
    background: #f0f0f0;
    color: #666;
}

.status-badge.running {
    background: #e3f2fd;
    color: #1976d2;
}

.status-badge.completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.error {
    background: #ffebee;
    color: #c62828;
}

/* Step Output */
.calc-step-output {
    padding: 0 16px 16px 76px;
    animation: slideDown 0.3s ease-out;
}

.calc-step-output.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 1000px;
        opacity: 1;
    }
}

.output-summary {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 16px;
    border-left: 4px solid #73a942;
}

.output-summary.recommended {
    border-left-color: #ffa726;
}

.output-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #2d5016;
}

.output-detail {
    margin-top: 16px;
}

.output-detail h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Tables */
.output-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 12px;
}

.output-table thead {
    background: #2d5016;
    color: white;
}

.output-table th,
.output-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.output-table tbody tr:hover {
    background: #f0f0f0;
}

.output-table tr.failed {
    opacity: 0.5;
    text-decoration: line-through;
}

.output-note {
    margin: 12px 0 0 0;
    padding: 12px;
    background: white;
    border-radius: 6px;
    font-size: 12px;
    color: #555;
    line-height: 1.5;
}

.output-note strong {
    color: #2d5016;
}

/* Recommended Date Banner */
.recommended-date-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
    border-radius: 8px;
    color: white;
    margin-bottom: 16px;
}

.banner-icon {
    font-size: 48px;
}

.banner-content {
    flex: 1;
}

.banner-content h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    opacity: 0.9;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.green-date-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 4px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.green-date-subtitle {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

/* Calculation Steps List */
.calculation-steps {
    margin: 0 0 16px 0;
    padding-left: 20px;
}

.calculation-steps li {
    margin-bottom: 12px;
    line-height: 1.6;
    font-size: 13px;
    color: #555;
}

.calculation-steps li strong {
    color: #2d5016;
}

/* Interpretation Box */
.interpretation {
    background: white;
    padding: 16px;
    border-radius: 6px;
    border: 2px solid #ffa726;
}

.interpretation h5 {
    margin: 0 0 12px 0;
    color: #fb8c00;
    font-size: 14px;
    font-weight: 600;
}

.interpretation p {
    margin: 0 0 12px 0;
    font-size: 13px;
    line-height: 1.6;
    color: #555;
}

.interpretation p:last-child {
    margin-bottom: 0;
}

.interpretation .note {
    padding: 12px;
    background: #fff3e0;
    border-radius: 4px;
    border-left: 3px solid #ffa726;
}

/* Milestone Example */
.milestone-example {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.milestone-example h5 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #2d5016;
}

.milestone-example p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #555;
}

/* Error Display */
.error {
    color: #c62828;
    padding: 12px;
    background: #ffebee;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

/* Footer */
.calc-progress-footer {
    background: white;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
}

.calc-overall-status {
    margin-bottom: 12px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.calc-progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.calc-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a7c2c 0%, #73a942 100%);
    transition: width 0.5s ease;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .calc-progress-container {
        top: 60px;
        right: 10px;
        left: 10px;
        width: auto;
        max-height: calc(100vh - 80px);
    }

    .calc-step-output {
        padding-left: 16px;
    }

    .output-stats {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar Styling */
.calc-progress-body::-webkit-scrollbar {
    width: 8px;
}

.calc-progress-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.calc-progress-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.calc-progress-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}
