/* リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本スタイル */
body {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

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

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

.header-title {
    font-size: 1.5rem;
}

.header-title a {
    color: #333;
    text-decoration: none;
}

.header-nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.header-nav a {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.header-nav a:hover {
    color: #FF6B6B;
}

.logout-form {
    margin: 0;
}

.logout-button {
    background: none;
    border: none;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: color 0.3s;
}

.logout-button:hover {
    color: #FF6B6B;
}

/* メイン */
.main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* フッター */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

.footer a {
    color: #fff;
    text-decoration: underline;
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: #FF6B6B;
    color: #fff;
}

.btn-primary:hover {
    background-color: #FF5252;
}

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

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-google:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* アラート */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #FF6B6B;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ホームページ */
.home-hero {
    text-align: center;
    padding: 3rem 0;
    background-color: #fff;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.home-hero h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #FF6B6B;
}

.hero-actions {
    margin-top: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #FF6B6B;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-card h4 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

/* 認証ページ */
.auth-container, .setup-container {
    max-width: 500px;
    margin: 0 auto;
}

.auth-box, .setup-box {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-box h2, .setup-box h2 {
    text-align: center;
    margin-bottom: 2rem;
}

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

.auth-actions {
    margin: 2rem 0;
}

.auth-notice, .setup-info {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    margin-top: 2rem;
}

.auth-notice h3, .setup-info h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.auth-notice ul, .setup-info ul {
    list-style: none;
    padding-left: 0;
}

.auth-notice li, .setup-info li {
    padding: 0.25rem 0;
}

/* カレンダー */
.calendar {
    background-color: #fff;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-header {
    text-align: center;
    font-weight: 700;
    padding: 0.5rem;
    background-color: #f8f9fa;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    position: relative;
    font-size: 0.875rem;
}

.calendar-day.other-month {
    color: #ccc;
}

.calendar-day.checked {
    background-color: #FF6B6B;
    color: #fff;
}

.calendar-legend {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: #666;
}

/* カード画面 */
.mycard-container, .card-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-header h2 {
    margin: 0;
}

.edit-form-container {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    margin: 1rem 0;
    border: 1px solid #dee2e6;
}

.edit-form .form-group {
    margin-bottom: 1rem;
}

.edit-form .form-actions {
    display: flex;
    gap: 0.5rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FF6B6B;
}

.checkin-section {
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.checkin-section button {
    margin-top: 0.5rem;
}

.checkin-complete {
    color: #28a745;
    font-size: 1.125rem;
    font-weight: 500;
}

.checkin-unavailable {
    color: #6c757d;
}

.share-section {
    text-align: center;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-top: 2rem;
}

.share-section code {
    display: block;
    padding: 0.5rem;
    background-color: #e9ecef;
    border-radius: 4px;
    margin: 0.5rem 0;
    word-break: break-all;
}

/* 参加者一覧 */
.participants-container {
    max-width: 1000px;
    margin: 0 auto;
}

.filters {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.filter-forms {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.participants-table-wrapper {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.participants-table {
    width: 100%;
    border-collapse: collapse;
}

.participants-table th {
    background-color: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 500;
    border-bottom: 2px solid #dee2e6;
}

.participants-table td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.participants-table tr:hover {
    background-color: #f8f9fa;
}

.participants-table a {
    color: #FF6B6B;
    text-decoration: none;
    font-weight: 500;
}

.participants-table a:hover {
    text-decoration: underline;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-link, .page-current {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    text-decoration: none;
}

.page-link {
    background-color: #fff;
    color: #FF6B6B;
    border: 1px solid #FF6B6B;
}

.page-link:hover {
    background-color: #FF6B6B;
    color: #fff;
}

.page-current {
    background-color: #FF6B6B;
    color: #fff;
}

/* エラーページ */
.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

.error-box {
    text-align: center;
    max-width: 500px;
}

.error-code {
    font-size: 5rem;
    font-weight: 700;
    color: #FF6B6B;
    margin-bottom: 1rem;
}

.error-actions {
    margin-top: 2rem;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .header-nav ul {
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filter-forms {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-form {
        width: 100%;
    }
    
    .filter-group {
        flex: 1;
    }
    
    .btn-sm {
        flex: 0 0 auto;
    }

    .participants-table-wrapper {
        overflow-x: auto;
    }

    .participants-table {
        min-width: 600px;
    }
}