/**
 * picoKit - 管理画面共通CSS
 * メインカラー: #0097d3
 */

/* ============================================
   リセット・ベース
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: #0097d3;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================
   ヘッダー
   ============================================ */
.header {
    background: linear-gradient(135deg, #0097d3 0%, #0078a8 100%);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.3rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.shop-name {
    font-size: 0.9rem;
    opacity: 0.9;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    text-decoration: none;
}

/* ============================================
   ナビゲーション
   ============================================ */
.nav {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 24px;
}

.nav ul {
    list-style: none;
    display: flex;
    gap: 8px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav li {
    margin: 0;
}

.nav a {
    display: block;
    padding: 16px 20px;
    color: #666;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav a:hover,
.nav a.active {
    color: #0097d3;
    border-bottom-color: #0097d3;
    text-decoration: none;
}

/* ============================================
   メインコンテンツ
   ============================================ */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
}

.breadcrumb {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 16px;
}

.breadcrumb a {
    color: #0097d3;
}

/* ============================================
   カード
   ============================================ */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* ============================================
   統計カード
   ============================================ */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

/* ============================================
   ボタン
   ============================================ */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #0097d3;
    color: white;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.btn:hover {
    background: #0086be;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

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

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

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-outline {
    background: transparent;
    border: 2px solid #0097d3;
    color: #0097d3;
}

.btn-outline:hover {
    background: #0097d3;
    color: white;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group .required {
    color: #dc3545;
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #0097d3;
    box-shadow: 0 0 0 3px rgba(0, 151, 211, 0.1);
}

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

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

.form-hint {
    font-size: 0.85rem;
    color: #888;
    margin-top: 6px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

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

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    font-weight: 500;
    color: #888;
    font-size: 0.85rem;
    background: #fafafa;
}

.table tbody tr:hover {
    background: #f9f9f9;
}

.table a {
    color: #0097d3;
}

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

.status.open {
    background: #e8f5e9;
    color: #4CAF50;
}

.status.closed {
    background: #fafafa;
    color: #888;
}

.status.decided {
    background: #e1f5fe;
    color: #0097d3;
}

/* ============================================
   アラート・メッセージ
   ============================================ */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

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

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

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #e1f5fe;
    color: #0277bd;
    border: 1px solid #b3e5fc;
}

/* ============================================
   空状態
   ============================================ */
.empty {
    text-align: center;
    color: #888;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty p {
    margin-bottom: 8px;
}

/* ============================================
   候補日入力（日程調整用）
   ============================================ */
.candidate-list {
    margin-top: 16px;
}

.candidate-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
}

.candidate-item input[type="date"] {
    flex: 1;
    max-width: 180px;
}

.candidate-item input[type="time"] {
    width: 120px;
}

.candidate-item .remove-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px 8px;
}

.candidate-item .remove-btn:hover {
    background: #fee;
    border-radius: 4px;
}

.add-candidate-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f0f9ff;
    border: 2px dashed #0097d3;
    border-radius: 8px;
    color: #0097d3;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.add-candidate-btn:hover {
    background: #e1f5fe;
}

/* ============================================
   ログイン画面
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f5f7fa;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 1.8rem;
    color: #333;
}

.login-logo p {
    color: #888;
    font-size: 0.9rem;
    margin-top: 5px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #0097d3 0%, #0078a8 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 151, 211, 0.4);
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #0097d3;
}

/* ============================================
   共有URL表示
   ============================================ */
.share-url-box {
    background: #f5f7fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
}

.share-url-box label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.share-url-input {
    display: flex;
    gap: 8px;
}

.share-url-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
}

.copy-btn {
    padding: 10px 16px;
    background: #0097d3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #0086be;
}

/* ============================================
   回答集計表示
   ============================================ */
.response-table {
    overflow-x: auto;
}

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

.response-table .answer {
    text-align: center;
    font-size: 1.2rem;
}

.response-table .answer-ok { color: #4CAF50; }
.response-table .answer-maybe { color: #FF9800; }
.response-table .answer-ng { color: #f44336; }

.response-summary {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
}

.response-summary span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   レスポンシブ
   ============================================ */
@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
    }
    
    .header h1 {
        font-size: 1.1rem;
    }
    
    .nav {
        padding: 0 16px;
    }
    
    .nav a {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
    
    .main {
        padding: 16px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    .candidate-item {
        flex-wrap: wrap;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 10px 12px;
    }
}
