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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
    background-color: #f5f7fa;
    color: #2d3748;
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

/* メインレイアウト */
.app-container {
    display: flex;
    height: 100vh;
}

/* 左サイドバー */
.sidebar {
    width: 320px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
}

/* メインコンテンツ */
.main-content {
    flex: 1;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* セクション共通スタイル */
.sidebar section {
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.sidebar section:last-child {
    border-bottom: none;
    margin-top: auto;
}

/* セクションタイトル */
.sidebar h3 {
    font-size: 16px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar h3 span {
    font-size: 18px;
}

/* レイアウト選択 */
.layout-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layout-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.layout-option:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
}

.layout-option input[type="radio"] {
    margin: 0;
    margin-right: 12px;
    accent-color: #3182ce;
}

.layout-option input[type="radio"]:checked + .layout-name {
    color: #3182ce;
    font-weight: 600;
}

.layout-name {
    font-size: 14px;
    color: #4a5568;
    transition: all 0.2s;
}

/* トグルスイッチ */
.toggle-switch {
    appearance: none;
    width: 44px;
    height: 24px;
    background: #cbd5e0;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-switch:checked {
    background: #3182ce;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s;
}

.toggle-switch:checked::before {
    left: 22px;
}

/* 入力グループ */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 8px;
}

/* ラベルとトグルが統合された場合のスタイル */
.label-with-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    width: 100%;
}

.label-with-toggle > span {
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-text-label {
    font-size: 12px;
    color: #718096;
}

.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    background: white;
    transition: border-color 0.2s;
}

.input-group textarea:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 1px rgba(49, 130, 206, 0.1);
}

.help-text {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
}

/* スライダーコントロール */
.size-control {
    margin-bottom: 15px;
}

.size-control label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 8px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    outline: none;
    appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #3182ce;
    cursor: pointer;
}

.slider-container span {
    font-size: 12px;
    color: #718096;
    min-width: 30px;
    text-align: right;
}

/* ダウンロードセクション */
.download-section {
    padding: 20px !important;
}

.download-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3182ce 0%, #2b77cb 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
}

.format-selection {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.format-selection label {
    font-size: 12px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.format-selection input[type="radio"] {
    accent-color: #3182ce;
}

/* プレビューコンテナ */
.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 1100px;
}

/* バナープレビュー */
.banner-preview {
    width: 100%;
    max-width: 1000px;
    aspect-ratio: 1000/400;
    background: white;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.preview-info {
    font-size: 12px;
    color: #718096;
    text-align: center;
    max-width: 640px;
}

.preview-info span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* バナー内コンテンツ */
.banner-content {
    position: absolute;
    top: 50%;
    left: 96px;
    transform: translateY(-50%);
    z-index: 2;
    max-width: 53%;
}

.subtitle-text {
    font-size: 24px;
    font-weight: bold;
    color: #718096;
    margin-top: 8px;
    line-height: 1.3;
}

.main-title {
    font-size: 48px;
    font-weight: bold;
    color: #2d3748;
    line-height: 1.2;
    white-space: pre-line;
}

.small-text {
    font-size: 0.7em;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    
    .sidebar {
        width: 100%;
        max-height: 60vh;
    }
    
    .main-content {
        padding: 15px;
    }
    
    body {
        overflow: visible;
        height: auto;
    }
}