/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-color: #080710;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(244, 63, 94, 0.4); /* Rose accent color */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --primary-gradient: linear-gradient(135deg, #f43f5e 0%, #a855f7 50%, #6366f1 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --accent-color: #f43f5e;
    --font-sans: 'Inter', 'Noto Sans KR', sans-serif;
    --font-display: 'Outfit', 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Background Blobs */
.background-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.2;
    animation: floatBlob 25s infinite ease-in-out alternate;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: #f43f5e;
    top: -100px;
    right: -100px;
}

.blob-2 {
    width: 600px;
    height: 600px;
    background: #a855f7;
    bottom: -150px;
    left: -150px;
    animation-delay: -5s;
    animation-duration: 30s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: #6366f1;
    top: 40%;
    left: 30%;
    opacity: 0.1;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 80px) scale(1.15); }
}

/* Layout Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3.5rem;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.back-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
}

.logo-icon {
    font-size: 2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text {
    color: var(--text-primary);
}

.logo-text .highlight {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-tag {
    font-size: 0.85rem;
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.08);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    border: 1px solid rgba(244, 63, 94, 0.15);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: #fda4af;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 1rem;
    border-radius: 100px;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hero-section h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #ffffff, #fda4af, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* Glass Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.card:hover {
    border-color: var(--card-hover-border);
    box-shadow: 0 12px 40px 0 rgba(244, 63, 94, 0.15);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
}

.card-title span {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-title i {
    color: var(--accent-color);
}

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .header-left {
        width: 100%;
        justify-content: space-between;
    }
}

/* Guide Card */
.guide-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    justify-content: space-between;
}

.guide-content p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Dropzone Card */
.upload-zone-wrapper {
    display: flex;
    flex-direction: column;
}

.dropzone-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
}

.dropzone-card.dragover {
    border-color: var(--accent-color);
    background: rgba(244, 63, 94, 0.06);
    transform: scale(1.02);
}

.dropzone-content {
    text-align: center;
    pointer-events: none;
}

.upload-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
}

.dropzone-card:hover .upload-icon-wrapper,
.dropzone-card.dragover .upload-icon-wrapper {
    transform: translateY(-5px);
    background: var(--primary-gradient);
    box-shadow: 0 8px 24px rgba(244, 63, 94, 0.3);
    border-color: transparent;
}

.cloud-icon {
    font-size: 1.8rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.dropzone-card:hover .cloud-icon,
.dropzone-card.dragover .cloud-icon {
    color: #ffffff;
}

.dropzone-content h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.dropzone-content p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.file-limits {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.3rem 0.7rem;
    border-radius: 100px;
}

/* File Info Card */
.file-info-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.file-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    position: relative;
}

.file-icon {
    font-size: 1.8rem;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-meta h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    word-break: break-all;
    padding-right: 2rem;
}

.file-meta p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.remove-file-btn {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-file-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    transform: translateY(-50%) rotate(90deg);
}

/* Status Badges */
.processing-status {
    display: flex;
    justify-content: center;
    align-items: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.15rem;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 600;
}

.status-badge.processing {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.9rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.25);
}

.btn-primary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
}

.btn-primary:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.template-btn {
    padding: 0.75rem;
    font-size: 0.88rem;
    border-radius: 10px;
}

/* Stats Section */
.stats-card {
    margin-bottom: 2rem;
    animation: fadeIn 0.4s ease forwards;
}

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

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-indicator {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 1.25rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-indicator.total { border-left: 4px solid #6366f1; }
.stat-indicator.success { border-left: 4px solid #10b981; }
.stat-indicator.warning { border-left: 4px solid #f59e0b; }
.stat-indicator.error { border-left: 4px solid #ef4444; }

.stat-indicator:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.04);
}

.stat-num {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.total .stat-num { color: #818cf8; }
.success .stat-num { color: #34d399; }
.warning .stat-num { color: #fbbf24; }
.error .stat-num { color: #f87171; }

.stat-lbl {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Preview Card */
.preview-card {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1rem;
}

.preview-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-header h2 i {
    color: var(--accent-color);
}

.preview-subtitle {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.badge {
    background: rgba(244, 63, 94, 0.15);
    color: #fda4af;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.table-container {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    max-height: 400px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.preview-table th {
    background: rgba(16, 20, 40, 0.95);
    color: #fda4af;
    font-weight: 600;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    position: sticky;
    top: 0;
    white-space: nowrap;
    z-index: 10;
}

.preview-table td {
    padding: 0.8rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    white-space: nowrap;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-table tbody tr {
    transition: background-color 0.2s ease;
}

.preview-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.table-container::-webkit-scrollbar { width: 8px; height: 8px; }
.table-container::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
.table-container::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 10px; }
.table-container::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }

/* Validation status badges in cells */
.cell-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.cell-badge.ok {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.cell-badge.warn {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.cell-badge.err {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.empty-cell-placeholder {
    color: rgba(255, 255, 255, 0.15);
    font-style: italic;
    font-size: 0.8rem;
}

.highlight-url {
    color: #fda4af;
    text-decoration: underline;
    cursor: pointer;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(13, 12, 21, 0.9);
    border: 1px solid #f43f5e;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Footer */
.app-footer {
    margin-top: auto;
    padding: 3rem 0 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
