/* ===== 기본 설정 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FA0030;
    --primary-dark: #c70026;
    --secondary-color: #000000;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-dark: #000000;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, #FA0030 0%, #000000 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero-content {
    animation: fadeInUp 0.8s ease-out;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-title i {
    margin-right: 15px;
}

.hero-subtitle {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 40px;
    opacity: 0.95;
}

.hero-subtitle strong {
    font-weight: 700;
    text-decoration: underline;
}

.value-props {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.value-prop {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 500;
}

.value-prop i {
    color: var(--secondary-color);
    font-size: 1.3rem;
}

/* ===== Upload Section ===== */
.upload-section {
    padding: 60px 0;
    background: white;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-title i {
    color: var(--primary-color);
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    background: var(--bg-light);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: #eff6ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.upload-area p {
    color: var(--text-light);
    margin-bottom: 25px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-info {
    margin-top: 20px;
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.upload-info p {
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-info i {
    color: var(--primary-color);
}

/* ===== Results Section ===== */
.results-section {
    padding: 60px 0;
    background: var(--bg-light);
}

.table-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table thead {
    background: linear-gradient(135deg, #FA0030 0%, #000000 100%);
    color: white;
}

.data-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--bg-light);
}

.data-table tbody tr.total-row {
    background: #fef3c7;
    font-weight: 700;
    border-top: 2px solid var(--warning-color);
}

.data-table tbody tr.total-row:hover {
    background: #fde68a;
}

.data-table td {
    padding: 14px 12px;
    color: var(--text-dark);
}

.data-table td.positive {
    color: var(--secondary-color);
    font-weight: 600;
}

.data-table td.negative {
    color: var(--danger-color);
    font-weight: 600;
}

/* ===== Charts ===== */
.charts-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.chart-box {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.chart-box-wide {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
    text-align: center;
}

.chart-container {
    position: relative;
}

/* ===== Download Section ===== */
.download-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
}

.download-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-download {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-download:hover {
    background: #333333;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== Share Section ===== */
.share-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
}

.share-description {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

.share-form {
    margin-top: 20px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.title-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.title-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.share-url-box {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 25px;
    margin-top: 25px;
    border: 2px solid var(--secondary-color);
}

.share-url-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.share-url-header i {
    font-size: 1.3rem;
}

.share-url-content {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.share-url-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.95rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-family: 'Courier New', monospace;
    color: var(--text-dark);
}

.btn-copy {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-copy:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-url-info {
    color: var(--text-light);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* ===== Info Section ===== */
.info-section {
    padding: 60px 0;
    background: white;
}

.section-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.btn-toggle-info {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-toggle-info:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-toggle-info i {
    transition: transform 0.3s ease;
}

.btn-toggle-info.active i {
    transform: rotate(180deg);
}

.info-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.info-card {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.info-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card h3 i {
    color: var(--primary-color);
}

.info-card ul {
    list-style: none;
    padding-left: 0;
}

.info-card li {
    padding: 8px 0;
    color: var(--text-dark);
    line-height: 1.6;
}

.info-card li strong {
    color: var(--primary-color);
}

.message-box {
    background: linear-gradient(135deg, #FA0030 0%, #000000 100%);
    color: white;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.message-box h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.message-box p {
    font-size: 1.1rem;
    opacity: 0.95;
    line-height: 1.7;
}

/* ===== Footer ===== */
.footer {
    background: var(--text-dark);
    color: white;
    text-align: center;
    padding: 30px 0;
}

.footer p {
    opacity: 0.9;
}

/* ===== Notification ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--secondary-color);
}

.notification-success i {
    color: var(--secondary-color);
    font-size: 1.3rem;
}

.notification-info {
    border-left: 4px solid var(--primary-color);
}

.notification-info i {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.notification span {
    color: var(--text-dark);
    font-weight: 500;
}

/* ===== Viewer Page Styles ===== */
.loading-screen,
.error-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
}

.loading-content,
.error-content {
    text-align: center;
    padding: 40px;
}

.loading-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.error-icon {
    font-size: 4rem;
    color: var(--danger-color);
    margin-bottom: 20px;
}

.loading-content h2,
.error-content h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.loading-content p,
.error-content p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.viewer-header {
    background: linear-gradient(135deg, #FA0030 0%, #000000 100%);
    color: white;
    padding: 30px 0;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-title i {
    font-size: 2rem;
}

.header-title h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.created-date {
    font-size: 0.95rem;
    opacity: 0.9;
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.btn-secondary:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .value-props {
        flex-direction: column;
        gap: 15px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-title-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-toggle-info {
        width: 100%;
        justify-content: center;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .download-buttons {
        flex-direction: column;
    }

    .btn-download {
        width: 100%;
        justify-content: center;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .share-url-content {
        flex-direction: column;
    }

    .btn-copy {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 50px 0;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .upload-info {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===== Utility Classes ===== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}
