/* ===== CSS Variables ===== */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);

    --bg-dark: #0f0f1a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.1);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);

    --accent-blue: #667eea;
    --accent-purple: #764ba2;
    --accent-pink: #f093fb;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(102, 126, 234, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Background ===== */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(240, 147, 251, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

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

/* ===== Header ===== */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ===== Upload Section ===== */
.upload-section {
    animation: fadeInUp 0.6s ease 0.1s both;
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent-blue);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.drop-zone.has-file {
    border-color: #38ef7d;
    border-style: solid;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    width: 64px;
    height: 64px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.upload-icon svg {
    width: 32px;
    height: 32px;
    color: var(--accent-blue);
}

.drop-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.drop-subtext {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.file-select-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-gradient);
    color: white;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.file-select-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.file-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 1rem;
}

.hint-sub {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ===== Section Title ===== */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* ===== Options Section ===== */
.options-section {
    animation: fadeInUp 0.6s ease 0.2s both;
}

.option-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-card {
    display: block;
    cursor: pointer;
}

.option-card input {
    display: none;
}

.option-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.option-card:hover .option-content {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.option-card input:checked+.option-content {
    border-color: var(--accent-blue);
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.15);
}

.option-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-info {
    flex: 1;
}

.option-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.option-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.option-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-normal);
}

.option-check svg {
    width: 14px;
    height: 14px;
    color: white;
}

.option-card input:checked+.option-content .option-check {
    opacity: 1;
    transform: scale(1);
    background: var(--primary-gradient);
    border-color: transparent;
}

/* ===== Stats Section ===== */
.stats-section {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.stats-section.visible {
    display: block;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ===== Action Section ===== */
.action-section {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.action-section.visible {
    display: block;
}

.convert-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary-gradient);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.convert-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.convert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* ===== Progress Section ===== */
.progress-section {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.progress-section.visible {
    display: block;
}

.progress-bar {
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Result Section ===== */
.result-section {
    display: none;
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.4s ease;
}

.result-section.visible {
    display: block;
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.result-section h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.result-section p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.reset-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--accent-blue);
    font-weight: 500;
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.reset-btn:hover {
    background: var(--accent-blue);
    color: white;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 2rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Animations ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .container {
        padding: 1.5rem 1rem;
    }

    .header h1 {
        font-size: 1.4rem;
    }

    .logo {
        flex-direction: column;
    }

    .drop-zone {
        padding: 2rem 1.5rem;
    }

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

    .option-content {
        padding: 0.875rem 1rem;
    }

    .option-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}