/**
 * File Status Manager Styles
 * pdf.arrr.at 파일 상태 관리 공통 스타일
 */

/* File Card Container */
.file-cards-container {
    margin-top: 30px;
}

/* File Card */
.file-card {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.file-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* File Card States */
.file-card--ready {
    border-color: #6c757d;
}

.file-card--ready::before {
    background: #6c757d;
}

.file-card--uploading {
    border-color: #0d6efd;
    background: linear-gradient(to right, rgba(13, 110, 253, 0.03) 0%, #ffffff 100%);
}

.file-card--uploading::before {
    background: #0d6efd;
    opacity: 1;
    animation: shimmer 2s infinite;
}

.file-card--processing {
    border-color: #ffc107;
    background: linear-gradient(to right, rgba(255, 193, 7, 0.05) 0%, #ffffff 100%);
}

.file-card--processing::before {
    background: #ffc107;
    opacity: 1;
    animation: shimmer 2s infinite;
}

.file-card--completed {
    border-color: #28a745;
    background: linear-gradient(to right, rgba(40, 167, 69, 0.03) 0%, #ffffff 100%);
}

.file-card--completed::before {
    background: #28a745;
    opacity: 1;
}

.file-card--error {
    border-color: #dc3545;
    background: linear-gradient(to right, rgba(220, 53, 69, 0.03) 0%, #ffffff 100%);
}

.file-card--error::before {
    background: #dc3545;
    opacity: 1;
}

/* File Header */
.file-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.file-icon {
    font-size: 3rem;
    line-height: 1;
    flex-shrink: 0;
}

.file-card--processing .file-icon {
    animation: spin 2s linear infinite;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 6px;
    word-break: break-word;
}

.file-meta {
    font-size: 0.9rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.savings-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Status Badge */
.file-status {
    margin-bottom: 16px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.status-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.status-time {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-left: 4px;
}

.status-badge--ready {
    background: #e9ecef;
    color: #495057;
}

.status-badge--uploading {
    background: #cfe2ff;
    color: #084298;
}

.status-badge--uploading .status-icon {
    animation: pulse 1.5s ease infinite;
}

.status-badge--processing {
    background: #fff3cd;
    color: #997404;
}

.status-badge--processing .status-icon {
    animation: spin 2s linear infinite;
}

.status-badge--completed {
    background: #d1e7dd;
    color: #0f5132;
}

.status-badge--completed .status-icon {
    animation: bounceIn 0.6s ease;
}

.status-badge--error {
    background: #f8d7da;
    color: #842029;
}

.status-badge--error .status-icon {
    animation: shake 0.5s ease;
}

/* Progress Container */
.progress-container {
    width: 100%;
    height: 32px;
    background: #e9ecef;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
    position: relative;
}

.file-card--uploading .progress-bar {
    background: linear-gradient(90deg, #0d6efd 0%, #0a58ca 100%);
}

.file-card--processing .progress-bar {
    background: linear-gradient(90deg, #ffc107 0%, #ffca2c 100%);
}

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

.progress-text {
    position: relative;
    z-index: 1;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Error Message */
.error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 8px;
    color: #842029;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.error-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* Action Buttons */
.file-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.action-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.2rem;
}

.action-btn--download {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.action-btn--download:hover {
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    animation: pulse 1.5s ease infinite;
}

.action-btn--new-upload {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-btn--new-upload:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.action-btn--retry {
    background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%);
    color: #000;
}

.action-btn--retry:hover {
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.action-btn--delete,
.action-btn--cancel {
    background: linear-gradient(135deg, #6c757d 0%, #5c636a 100%);
    color: white;
}

.action-btn--delete:hover,
.action-btn--cancel:hover {
    background: linear-gradient(135deg, #dc3545 0%, #bb2d3b 100%);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

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

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .file-card {
        padding: 20px;
    }

    .file-header {
        gap: 12px;
    }

    .file-icon {
        font-size: 2.5rem;
    }

    .file-name {
        font-size: 1rem;
    }

    .file-meta {
        font-size: 0.85rem;
    }

    .file-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        min-width: auto;
    }

    .progress-container {
        height: 28px;
    }

    .progress-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .file-card {
        padding: 16px;
    }

    .file-icon {
        font-size: 2rem;
    }

    .status-badge {
        font-size: 0.85rem;
        padding: 8px 14px;
    }

    .action-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
