/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本スタイル */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

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

/* ヘッダー */
header {
    text-align: center;
    margin-bottom: 40px;
    background: white;
    padding: 40px 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
}

/* アラート */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f1aeb5;
}

.alert-success {
    background-color: #d1edff;
    color: #0f5132;
    border: 1px solid #a3cfbb;
}

/* セクションスタイル */
.upload-section,
.preview-section,
.download-section,
.info-section {
    background: white;
    margin-bottom: 30px;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.upload-section h2,
.preview-section h2,
.download-section h2,
.info-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: 600;
}

/* ファイルアップロード */
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.file-upload-wrapper {
    position: relative;
    border: 3px dashed #3498db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.file-upload-wrapper:hover {
    border-color: #2980b9;
    background: #e3f2fd;
    transform: translateY(-2px);
}

.file-upload-wrapper.drag-over {
    border-color: #27ae60;
    background: #e8f5e8;
}

#poster_image {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-label {
    display: block;
    cursor: pointer;
    font-size: 1.1rem;
    color: #3498db;
    font-weight: 500;
}

.file-upload-text::before {
    content: "📁 ";
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

/* ボタン */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    font-size: 1.1rem;
    padding: 15px 40px;
}

.btn-success:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.btn-download {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    font-size: 1.2rem;
    padding: 18px 45px;
}

.btn-download:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

/* 画像プレビュー */
.image-preview {
    text-align: center;
    margin-bottom: 30px;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    object-fit: contain;
}

/* ポスター設定 */
.poster-settings {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.poster-settings h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.settings-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #34495e;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input[type="color"] {
    height: 45px;
    padding: 5px;
    cursor: pointer;
}

/* ダウンロードセクション */
.pdf-info {
    background: #e8f5e8;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid #27ae60;
}

.pdf-info ul {
    list-style: none;
    color: #27ae60;
    font-weight: 500;
}

.pdf-info li {
    padding: 5px 0;
}

.pdf-info li::before {
    content: "✓ ";
    color: #27ae60;
    font-weight: bold;
}

/* 情報セクション */
.info-section ol {
    padding-left: 20px;
    margin-bottom: 30px;
}

.info-section li {
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.technical-specs {
    background: #f1f2f6;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.technical-specs h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.technical-specs ul {
    list-style-type: none;
    color: #555;
}

.technical-specs li {
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}

.technical-specs li:last-child {
    border-bottom: none;
}

.technical-specs li::before {
    content: "⚙️ ";
    margin-right: 8px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        padding: 30px 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .upload-section,
    .preview-section,
    .download-section,
    .info-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .settings-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .file-upload-wrapper {
        padding: 30px 15px;
    }
    
    .btn {
        font-size: 0.95rem;
        padding: 12px 25px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .upload-section h2,
    .preview-section h2,
    .download-section h2,
    .info-section h2 {
        font-size: 1.5rem;
    }
    
    .file-upload-wrapper {
        padding: 25px 10px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* アニメーション */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-section,
.preview-section,
.download-section {
    animation: fadeInUp 0.6s ease-out;
}

/* ローディングスピナー */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* プログレスバー */
.progress-container {
    display: none;
    margin-top: 15px;
}

.progress-container.show {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #666;
}