:root {
    --primary-dark: #3b3039;
    --primary-medium: #855f87;
    --primary-light: #c9c7cd;
    --accent-dark: #474045;
    --text-primary: #333;
    --text-secondary: #666;
    --background-white: #ffffff;
    --border-light: #e1e5e9;
    --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--primary-medium) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    padding: 20px;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.header-icon {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

header h1 {
    font-size: 2.2rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1rem;
    opacity: 0.9;
}

main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    main {
        gap: 25px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    .form-section h2 {
        font-size: 1.2rem;
    }
}

.form-section, .requests-section {
    background: var(--background-white);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px var(--shadow);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
}

.form-header:hover {
    background-color: rgba(133, 95, 135, 0.08);
}

.form-header:focus {
    outline: 2px solid var(--primary-medium);
    outline-offset: 2px;
}

.form-section h2, .requests-section h2 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.3rem;
    pointer-events: none;
}

.toggle-icon {
    display: block;
    font-size: 16px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    pointer-events: none;
}

.form-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.form-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 1000px;
    opacity: 1;
}

.form-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.form-group {
    margin-bottom: 12px;
}


label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
}

input[type="text"], textarea, select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

input[type="text"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-medium);
}

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

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-medium) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(133, 95, 135, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.filter-bar {
    margin-bottom: 20px;
}

.filter-bar select {
    width: 200px;
}

.requests-list {
    /* スクロール制限を削除 */
}

/* SEO対応: セマンティックHTML要素のスタイリング */
main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

/* アクセシビリティ向上 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高コントラスト対応 */
@media (prefers-contrast: high) {
    :root {
        --primary-dark: #1a1a1a;
        --primary-medium: #4a4a4a;
        --text-primary: #000;
        --text-secondary: #333;
    }
}

/* ダークモード対応は無効化（読みやすさのため） */
/* @media (prefers-color-scheme: dark) {
    :root {
        --background-white: #2a2a2a;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --border-light: #555555;
    }
} */

.request-card {
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s ease;
}

.request-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 16px;
}

.request-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
}


.category-tag {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(133, 95, 135, 0.15);
    color: var(--primary-dark);
    border: 1px solid rgba(133, 95, 135, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.request-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 12px;
}

.request-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.request-date {
    color: #999;
    font-size: 14px;
}

.like-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.like-btn:hover:not(:disabled) {
    border-color: var(--primary-medium);
    color: var(--primary-medium);
    transform: translateY(-1px);
}

.like-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.like-btn.liked {
    border-color: var(--primary-medium);
    background-color: rgba(133, 95, 135, 0.1);
    color: var(--primary-medium);
}

.like-icon {
    font-size: 16px;
    line-height: 1;
}

.like-count {
    font-size: 14px;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.loading {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px;
}

/* メッセージスタイル */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
    font-weight: 500;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.success {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}