/**
 * noteクリエイターダッシュボード - スタイルシート
 */

/* リセットと基本スタイル */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #41c9b4;
    --primary-hover: #35a899;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --radius-sm: 4px;
}

html {
    font-size: 16px;
    line-height: 1.5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* コンテナ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-logout {
    background-color: transparent;
    color: var(--text-muted);
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-logout:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

/* フォーム */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(65, 201, 180, 0.2);
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
}

/* アラート */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ログインページ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.login-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.login-form .btn {
    margin-top: 1rem;
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

/* ヘッダー */
.header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    font-size: 1.25rem;
    color: var(--text-color);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* メインコンテンツ */
.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 140px);
}

/* セクション */
.search-section,
.results-section {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.search-section h2,
.results-section h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.section-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ローディング */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* クリエイター情報 */
.creator-info {
    margin-bottom: 30px;
}

.creator-profile {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--light-color);
    border-radius: var(--radius);
}

.creator-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.creator-details h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.creator-details p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* 統計情報 */
.stats-section {
    margin-bottom: 30px;
}

.stats-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--light-color);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* 記事一覧 */
.articles-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.table-container {
    overflow-x: auto;
}

.articles-table {
    width: 100%;
    border-collapse: collapse;
}

.articles-table th,
.articles-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.articles-table th {
    background: var(--light-color);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.articles-table td {
    font-size: 0.875rem;
}

.articles-table tbody tr:hover {
    background: var(--light-color);
}

.articles-table a {
    color: var(--primary-color);
    text-decoration: none;
}

.articles-table a:hover {
    text-decoration: underline;
}

/* フッター */
.footer {
    background: white;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-note {
    margin-top: 0.5rem;
    font-size: 0.75rem !important;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .creator-profile {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
