/* static/css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #06ffa5;
    --dark: #0f0f23;
    --text-primary: #f0f0f0;
    --text-secondary: #a8a8b3;
    --bg-dark: #09090b;
    --bg-card: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --success-color: #06ffa5;
    --fail-color: #ff6b6b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-dark);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header & Footer */
header, footer {
    background: rgba(15, 15, 35, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    flex-shrink: 0;
}
footer {
    border-bottom: none;
    border-top: 1px solid var(--border);
    margin-top: auto;
    padding: 2rem 0;
}
.header-content, .footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 24px;
    font-weight: 900;
    background: var(--primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}
.footer-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.footer-text a {
    color: var(--primary-color);
    text-decoration: none;
}
.footer-text a:hover { text-decoration: underline; }

/* Main Content */
main {
    flex-grow: 1;
    padding: 80px 0;
}

/* General Styles */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.text-center { text-align: center; }

h1, h2, h3 {
    background: linear-gradient(135deg, #ffffff 0%, #a8a8b3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

h1 { font-size: 2.8rem; line-height: 1.2; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1rem; }

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Form Styles */
.analyze-form {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}
.url-input {
    flex-grow: 1;
    padding: 1rem;
    font-size: 1rem;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: rgba(0,0,0,0.3);
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s;
}
.url-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}
.cta-button {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    white-space: nowrap;
}
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* Sections on Index Page */
.info-section { margin-top: 4rem; }
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* Loading Page */
.loading-container { padding: 4rem; }
.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--border);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Result Page */
.result-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}
.score-image-container { /* ★白背景の画像用コンテナ */
    background: white;
    padding: 2rem;
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
}
.score-image-container img {
    width: 100%;
    height: auto;
    display: block;
}
.score-text {
    font-size: 3rem;
    font-weight: 900;
    background: var(--primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.rank-text { color: var(--text-secondary); margin-top: -1rem; }
.comparison-text { font-size: 1.2rem; margin: 0.5rem 0; }
.share-button {
    display: inline-block;
    background: #1DA1F2; /* Twitter Blue */
    color: white;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}
.share-button:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(29, 161, 242, 0.3); }

.result-details { margin-top: 3rem; }
.scores-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.score-list { list-style: none; }
.score-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}
.score-icon {
    margin-right: 0.8rem;
    font-size: 1.2rem;
}
.score-icon.success { color: var(--success-color); }
.score-icon.fail { color: var(--fail-color); }
.score-reason { color: var(--text-secondary); font-size: 0.9rem; margin-left: 0.5rem; }

.suggestion-card { margin-top: 1rem; }
.suggestion-card h4 {
    color: var(--accent-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.suggestion-content {
    background: rgba(0,0,0,0.3);
    padding: 1rem;
    border-radius: 10px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: Consolas, monaco, monospace;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .subtitle { font-size: 1rem; }
    .analyze-form { flex-direction: column; }
    .scores-grid { grid-template-columns: 1fr; }
}

/* static/css/style.css の末尾に追記 */

/* --- サムネイル診断ページ用スタイル --- */
.thumbnail-form {
    margin-top: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-group input[type="file"],
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: rgba(0,0,0,0.3);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}
.form-group input[type="file"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}
.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.result-section {
    margin-top: 3rem;
}

.divider {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 2rem 0;
}

.result-previews {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.preview-item {
    text-align: center;
}
.preview-item img {
    max-width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.preview-item h4 {
    margin-bottom: 0.5rem;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.comparison-item {
    padding: 1.5rem;
}
.comparison-item h4 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}
.winner-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-weight: bold;
    background: var(--primary);
    color: white;
    margin-bottom: 0.8rem;
}
.reason {
    color: var(--text-primary);
}

.error-message {
    background-color: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--fail-color);
    color: var(--fail-color);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .form-grid, .result-previews {
        grid-template-columns: 1fr;
    }
}


/* --- ヘッダーナビゲーションのデザイン改善 --- */
.main-nav {
    display: flex;
    gap: 0.5rem; /* ボタン間の少しの隙間 */
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 50px; /* 角を丸くしてボタン風に */
    border: 1px solid transparent; /* 最初は枠線を見えなくする */
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-card); /* ホバー時に背景色を付ける */
    border-color: var(--border); /* ホバー時に枠線を表示 */
}

/* 外部リンクに少しだけ目印を付ける（任意） */
.nav-link.external::after {
    content: ' ↗';
    font-size: 0.8em;
}

/* --- レスポンシブ対応 (画面が狭い場合) --- */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    .main-nav {
        flex-wrap: wrap; /* リンクが画面幅を超える場合に折り返す */
        justify-content: center;
    }
}

