/* Matometer - メインスタイル */

:root {
    --primary-color: #e91e63;
    --primary-dark: #c2185b;
    --secondary-color: #9c27b0;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f5f5f5;
    --card-bg: #fff;
    --border-color: #ddd;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* コンテナ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ヘッダー */
.header {
    background: var(--card-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.logo:hover {
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav a {
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav a:hover {
    background: var(--bg-color);
    text-decoration: none;
}

.nav .btn {
    color: white;
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn:hover {
    text-decoration: none;
    opacity: 0.9;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 認証ページ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-box {
    background: var(--card-bg);
    padding: 50px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 450px;
}

.auth-box h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 32px;
}

.auth-box h2 {
    text-align: center;
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 30px;
}

.auth-form .form-group {
    margin-bottom: 24px;
}

.auth-form .form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.auth-form .form-control {
    padding: 16px 18px;
    font-size: 16px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    background: #fafafa;
}

.auth-form .form-control:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(233, 30, 99, 0.1);
}

.auth-form .btn {
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    margin-top: 10px;
}

.auth-links {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
}

.auth-links a {
    color: var(--primary-color);
    font-weight: 500;
}

/* フォーム */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.form-control::placeholder {
    color: #aaa;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 15px center;
    background-color: white;
    padding-right: 40px;
}

/* アラート */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

/* カード */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* 記事グリッド */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.article-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.article-card .thumbnail {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
    background: #eee;
    overflow: hidden;
}

.article-card .thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-card .content {
    padding: 15px;
}

.article-card .title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-light);
}

.article-card .site-name {
    color: var(--primary-color);
}

/* ユーザーダッシュボード */
.dashboard {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - 60px);
}

.sidebar {
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: block;
    padding: 12px 15px;
    color: var(--text-color);
    border-radius: 6px;
    transition: background 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--bg-color);
    text-decoration: none;
}

.sidebar-nav a.active {
    color: var(--primary-color);
    font-weight: 500;
}

.main-content {
    padding: 30px;
}

.page-title {
    font-size: 24px;
    margin-bottom: 20px;
}

/* テーブル */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-color);
    font-weight: 600;
}

.table tr:hover {
    background: #fafafa;
}

/* ステータスバッジ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-warning {
    background: #fff3e0;
    color: #e65100;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

.badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 20px 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.pagination a:hover {
    background: var(--bg-color);
    text-decoration: none;
}

.pagination .active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* カテゴリタブ */
.category-tabs {
    display: flex;
    gap: 10px;
    padding: 15px 0;
    overflow-x: auto;
}

.category-tabs a {
    padding: 8px 20px;
    background: var(--card-bg);
    border-radius: 20px;
    color: var(--text-color);
    white-space: nowrap;
    transition: all 0.2s;
}

.category-tabs a:hover,
.category-tabs a.active {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

/* コードブロック */
.code-block {
    background: #263238;
    color: #aed581;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* フッター */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: 40px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .header-inner {
        flex-direction: column;
        gap: 10px;
    }

    .article-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
}
