/* 変数定義（webapps/style.css と共通） */
:root {
    --primary-color: #4361ee;
    --primary-hover: #3a56d4;
    --secondary-color: #2ec4b6;
    --accent-color: #ff9f1c;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #2b2d42;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --radius-lg: 12px;
    --radius-md: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* Header Styles */
.main-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn-home {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    transition: color 0.2s;
}

.btn-home:hover {
    color: var(--primary-color);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Card & Info Section */
.card, .info-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.info-header h2 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s;
}

.collapsed .info-content {
    display: none;
}

.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.info-content {
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.usage-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.usage-step {
    position: relative;
    padding-left: 36px;
    font-size: 0.9rem;
}

.usage-step::before {
    content: attr(data-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

/* Converter Layout */
.form-title {
    font-size: 1.25rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-number {
    background: var(--primary-color);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    transition: all 0.3s;
    background: #fbfbfc;
    cursor: pointer;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary-color);
    background: #f0f3ff;
}

.file-label {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
}

/* File List */
.file-list {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 12px;
}

input[type="range"] {
    flex-grow: 1;
}

.num-input {
    width: 70px;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.unit-select {
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.bg-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hidden {
    display: none;
}

/* Result Area */
.result-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.download-all-btn, .clear-btn, .calculate-btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.calculate-btn {
    background: var(--primary-color);
    color: white;
    margin-top: 20px;
    width: 100%;
}

.download-all-btn {
    background: var(--secondary-color);
    color: white;
}

.clear-btn {
    background: #e9ecef;
    color: var(--text-main);
}

.result-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.result-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.result-preview {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #eee;
    background-image: 
        linear-gradient(45deg, #ddd 25%, transparent 25%),
        linear-gradient(-45deg, #ddd 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ddd 75%),
        linear-gradient(-45deg, transparent 75%, #ddd 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px 5px, 5px 0;
}

.result-info {
    padding: 8px;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-download-single {
    padding: 4px 8px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

@media (max-width: 768px) {
    .main-header-inner {
        flex-direction: column;
        gap: 12px;
    }
    .container {
        margin: 20px auto;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
}
