/**
 * 共通スタイルシート
 * /var/www/i.fitnesslink.jp/public_html/assets/css/common.css
 */

/* リンクのデフォルトスタイル */
a {
    color: #0066cc;
    text-decoration: none;
}

a:visited {
    color: #0066cc;
}

a:hover {
    text-decoration: underline;
}

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

/* 基本設定 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
}

/* ヘッダー共通 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-with-logout {
    justify-content: space-between;
    padding: 0 30px;
}

.logo-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    height: 50px;
    max-width: 200px;
    width: auto;
    object-fit: contain;
}

.gym-name {
    font-size: 24px;
    font-weight: bold;
}

.gym-name-en {
    font-size: 14px;
    margin-top: 0;
}

/* メインコンテナー */
.main-container {
    margin-top: 100px;
    padding: 20px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.main-container-wide {
    max-width: 1200px;
    padding: 30px;
}

/* カード共通 */
.card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 25px;
    padding-bottom: 10px;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.submit-button {
    width: 100%;
    padding: 14px;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* エラー・ヘルプメッセージ */
.error-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    color: #e74c3c;
    font-size: 18px;
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    padding: 10px;
    background: #fee;
    border-radius: 6px;
}

.help-text {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* ポップアップ */
.popup {
    position: absolute;
    background: rgba(51, 51, 51, 0.8);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 1001;
    max-width: 300px;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.popup::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(51, 51, 51, 0.8);
}

.popup-logo {
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
}

.popup-login {
    margin-top: 10px;
    position: relative;
}

/* ログアウトボタン */
.logout-form {
    display: inline;
}

.logout-button {
    padding: 4px 8px;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* メニューグリッド */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.menu-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.menu-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.menu-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.menu-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* ウェルカムカード */
.welcome-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
}

.member-info {
    color: #666;
    font-size: 16px;
    text-align: right;
}

.welcome-subtitle {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

/* 情報セクション */
.info-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.info-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.info-content {
    font-size: 15px;
    color: #666;
    line-height: 1.8;
}

/* フッター */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 50px;
    font-size: 14px;
}

/* アニメーション */
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* スムーススクロール */
html {
    scroll-behavior: smooth;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .header-with-logout {
        padding: 0 15px;
    }
    
    .gym-name {
        font-size: 18px;
    }
    
    .logo {
        max-width: 150px;
    }
    
    .main-container-wide {
        padding: 20px 15px;
    }
    
    .welcome-card {
        padding: 25px;
    }
    
    .welcome-title {
        font-size: 20px;
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 15px;
    }
    
    .card {
        padding: 25px;
    }
    
    .gym-name {
        font-size: 20px;
    }
    
    .logo {
        max-width: 120px;
    }
}

/* バーコードページ用スタイル */
.breadcrumb-title-block {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.breadcrumb {
    font-size: 14px;
    color: #333;
    margin-bottom: 15px;
}

.breadcrumb a {
    color: #0066cc;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 10px;
    color: #999;
}

.content-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.barcode-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.barcode-member-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.member-number {
    font-size: 16px;
    color: #666;
    margin-top: 3px;
}

.member-name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
}

.barcode-display {
    background: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    display: inline-block;
    min-height: 140px;
}

.barcode-image {
    margin: 10px auto;
    display: block;
    max-width: 100%;
    overflow: visible;
}

.barcode-image text {
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.usage-instructions {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    text-align: left;
}

.usage-title {
    font-size: 16px;
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.usage-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.usage-list li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
    color: #333;
}

.usage-list li:before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    color: #4caf50;
}

.back-button-container {
    text-align: center;
    margin-top: 30px;
}

/* 戻るボタン専用スタイル */
.btn-back {
    background: #495057;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-back:hover {
    background: #343a40;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    color: white;
    text-decoration: none;
}

/* モーダルスタイル */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 2001;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close {
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    text-align: center;
    overflow-y: auto;
    flex: 1;
}