:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --success-color: #10b981;
    --secondary-color: #6b7280;
    --background: #f9fafb;
    --surface: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kosugi Maru', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

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

.update-info {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.update-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    animation: pulse 2s ease-in-out infinite;
}

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

.update-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.feature-new {
    position: relative;
}

.new-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.5rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 1px;
}

main {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px var(--shadow);
}

.upload-section {
    margin-bottom: 2rem;
}

.drop-zone {
    border: 3px dashed var(--border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--background);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
    min-height: 150px;
    width: 100%;
}

.drop-zone-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.drop-zone.has-files .drop-zone-content {
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.drop-zone.has-files .drop-zone-text {
    display: none;
}

.drop-zone.has-files .upload-icon {
    width: 32px;
    height: 32px;
}

.drop-zone-text h2 {
    margin: 0;
    text-align: center;
}

.drop-zone-text p {
    margin: 0;
    text-align: center;
}

.drop-zone-message {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.upload-icon {
    color: var(--primary-color);
    opacity: 0.7;
    flex-shrink: 0;
}

.drop-zone h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
}

.drop-zone p {
    color: var(--text-secondary);
    margin: 0;
}

.browse-btn {
    margin-top: 1rem;
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.browse-btn:hover {
    background: var(--primary-hover);
}

.files-list {
    margin-top: 2rem;
}

.files-list h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

#filesContent {
    background: var(--background);
    border-radius: 8px;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.file-item:last-child {
    border-bottom: none;
}

.file-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.file-name {
    font-weight: 500;
    word-break: break-all;
}

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

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

.progress-section {
    margin: 2rem 0;
}

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

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
}

.result-section {
    text-align: center;
    padding: 2rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    margin: 2rem 0;
}

.result-section h3 {
    margin-bottom: 1.5rem;
    color: var(--success-color);
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.info-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
}

.info-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.info-card-icon svg {
    color: white;
}

.info-card-header h3 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
}

.info-card-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.step:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: translateX(4px);
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

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

.feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.feature:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: translateX(4px);
}

.feature-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: 10px;
}

.feature-text {
    flex: 1;
}

.feature-text strong {
    display: block;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.feature-text p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.4;
}

/* Update History Section */
.update-history {
    margin-top: 2rem;
    grid-column: 1 / -1;
}

.update-item {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.update-item:last-child {
    border-bottom: none;
}

.update-date {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 100px;
    font-size: 0.9rem;
}

.update-content {
    flex: 1;
}

.update-content strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.update-content ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.update-content li {
    margin: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.update-content code {
    background: var(--background);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-family: 'Monaco', 'Menlo', monospace;
    color: var(--primary-color);
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    padding-bottom: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.875rem;
    position: relative;
}

.footer-credit {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    font-size: 0.875rem;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    font-weight: 600;
    white-space: nowrap;
}

.footer-credit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.modal-content {
    background: var(--surface);
    border-radius: 12px;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

#previewFrame {
    width: 100%;
    height: 100%;
    min-height: 70vh;
    border: none;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 1.5rem;
    }

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

    .action-buttons,
    .result-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

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

    .info-card {
        padding: 1.5rem;
    }
}

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

.files-list,
.progress-section,
.result-section {
    animation: fadeIn 0.3s ease;
}
