:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --bg-color: #f8f9fa;
    --text-color: #343a40;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: var(--font-family);
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

header {
    background-color: var(--card-bg);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

header h1 a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.5rem;
}

header nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1rem;
}

header nav a, header nav span {
    text-decoration: none;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.2s;
}

header nav a:hover {
    background-color: #e9ecef;
}

#logout-button {
    cursor: pointer;
}

main {
    padding: 2rem 1rem;
}

section {
    margin-bottom: 2rem;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

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

.work-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.work-card a {
    text-decoration: none;
    color: inherit;
}

.work-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.work-card h3 {
    font-size: 1.1rem;
    margin: 1rem;
}

.work-card p {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin: 0 1rem 1rem;
}

#search-section input, #search-section .category-btn {
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

#search-section input {
    width: 100%;
    max-width: 400px;
}

#category-buttons {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.category-btn {
    background: none;
    cursor: pointer;
}

.category-btn:hover {
    background-color: #e9ecef;
}

footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    color: var(--secondary-color);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }
    .works-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        }
}

/* ローディングスピナー */
.loader {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid var(--primary-color); /* Blue */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* グローバルローディングオーバーレイ */
#global-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* エラーメッセージ */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    text-align: center;
}

/* お気に入りボタン */
.favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #ccc; /* デフォルトの色 */
    transition: color 0.2s;
}

.favorite-btn.is-favorited {
    color: #ff6347; /* お気に入り時の色 (トマト色) */
}

#logo {
    height: 40px;
    width: auto;
    vertical-align: middle;
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
}

#logo-text {
    margin-left: 12px;
    font-size: 1.7rem; /* ロゴの高さ40pxとバランスをとる */
    font-weight: 700; /* Bold */
    color: #343a40; /* var(--text-color) */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* 少しモダンなフォント */
    letter-spacing: 0.5px;
}
