/* --- SpeedyShare Professional CSS (完全修正版) --- */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --success: #10b981;
    --border: #e5e7eb;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-main);
}

.container {
    max-width: 500px;
    width: 90%;
    background: var(--card-bg);
    margin: 40px 20px;
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    text-align: center;
    box-sizing: border-box;
    /* 絶対に高さを固定しない */
    height: auto; 
    display: flex;
    flex-direction: column;
}

/* タイトル周り */
.brand-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin: 10px 0;
}

.limit-badge {
    background: linear-gradient(45deg, #4f46e5, #06b6d4);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
}

/* アップロードエリア */
.drop-zone {
    border: 2px dashed #cbd5e0;
    background: #f8fafc;
    padding: 30px;
    border-radius: 16px;
    cursor: pointer;
    margin: 20px 0;
}

.file-list-preview {
    text-align: left;
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 15px;
}

/* オプション全体のラッパー */
.options-group {
    max-width: 400px; /* ボタンの幅と合わせる */
    margin: 20px auto;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid #e0e0e0;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-item i {
    color: #555;
    font-size: 1.2rem;
    padding-left: 10px;
}

/* テキストボックスの見た目をモダンに */
.option-item input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 5px;
    font-size: 1rem;
    outline: none;
    color: #333;
}

/* ボタンとの間隔を詰めて一体感を出す */
.upload-main-btn {
    width: 100%;
    max-width: 420px; /* options-groupより少し広くして包容力を出す */
    margin: 0 auto;
    display: block;
    /* ...既存のスタイル... */
}

/* 結果表示ボックス（ここが重なりの原因でした） */
.result-box {
    margin-top: 25px;
    padding: 20px;
    border: 2px solid var(--success);
    border-radius: 16px;
    background: #f0fff4;
    /* 縦に並べる設定 */
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.success-msg {
    color: #065f46;
    font-weight: 700;
    margin: 0;
    text-align: center;
}

/* URL表示（はみ出し対策の決定版） */
#shareLink {
    width: 100%;
    /* inputではなくtextarea的に振る舞わせるため高さを自動に */
    min-height: 60px;
    padding: 12px;
    border: 1px solid #c6f6d5;
    border-radius: 8px;
    background: white;
    font-family: monospace;
    font-size: 13px;
    color: #334155;
    box-sizing: border-box;
    
    /* 強制折り返し */
    word-break: break-all;
    overflow-wrap: break-word;
    white-space: normal;
    
    /* リサイズ不可、枠線なし */
    resize: none;
    outline: none;
}

/* ボタン */
.upload-main-btn, .copy-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    width: 100%;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.copy-btn {
    background: var(--success);
}

/* トラストアイテム（文字かぶり防止） */
.trust-footer {
    display: flex;
    justify-content: space-around;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    gap: 5px;
}

.trust-item i {
    font-size: 18px;
    color: var(--primary);
}

/* ダウンロード画面のボタン */
.file-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.mini-download-btn {
    background: #f1f5f9;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    cursor: pointer;
    /* 長いファイル名対策 */
    word-break: break-all;
    gap: 10px;
}

/* 広告スロット */
.ad-slot {
    margin-top: 20px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    min-height: 100px;
}

.site-footer {
    margin: 30px 0;
    font-size: 12px;
    color: var(--text-muted);
}
/* SNSアイコンのデザイン */
.share-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed var(--success);
}

.share-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.sns-icon-list {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.sns-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ホバーで少し浮かせる */
.sns-icon:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 各SNSのブランドカラー */
.x-mark { background-color: #000000; }
.facebook { background-color: #1877F2; }
.whatsapp { background-color: #25D366; }
.telegram { background-color: #0088cc; }

/* スマホでのタップしやすさを考慮 */
@media (max-width: 480px) {
    .sns-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
}

/* ボタンがはみ出さないためのラッパー */
.bottom-actions {
    width: 100%;
    display: flex;
    justify-content: center; /* 中央寄せ */
    margin-top: 60px;
    margin-bottom: 80px;
    padding: 0 20px; /* 画面端への衝突防止 */
    box-sizing: border-box; /* パディングを含めて計算 */
}

/* Aboutページ専用の戻るボタン（アンバランス解消版） */
.back-home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    
    /* 幅の制御：はみ出し防止 */
    width: 100%;
    max-width: 350px; /* 広がりすぎを防ぐ */
    
    padding: 16px 32px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 50px; /* 丸みを持たせて「戻る」感を演出 */
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    
    /* 重要な修正点 */
    box-sizing: border-box; 
}

.back-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    filter: brightness(1.1);
}

.back-home-btn i {
    font-size: 1.1rem;
}

/* モバイル対応：さらに余白を調整 */
@media (max-width: 480px) {
    .bottom-actions {
        padding: 0 15px;
    }
    .back-home-btn {
        font-size: 0.95rem;
    }
}

.pw-area-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px dashed #ccc;
}

.pw-field {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box; /* はみ出し防止！ */
}