/**
 * Pawmy マイナンバー管理 - フロントエンドスタイル
 * Phase 2.5-1: ユーザー向けペット情報管理画面
 * Version: 2.5.6
 */

/* ========================================
   テーブル表示
======================================== */
.pawmy-frontend-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pawmy-frontend-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pawmy-frontend-table thead {
    background-color: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

.pawmy-frontend-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.pawmy-frontend-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.pawmy-frontend-table tbody tr:hover {
    background-color: #f9f9f9;
}

.pawmy-frontend-table td {
    padding: 12px;
    vertical-align: middle;
}

.pawmy-frontend-table .pawmy-number {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #2271b1;
}

.pawmy-frontend-table .pawmy-actions {
    white-space: nowrap;
}

.pawmy-frontend-table .pawmy-btn-small {
    padding: 6px 12px;
    font-size: 13px;
    margin-right: 4px;
}

.pawmy-duplicate-row {
    background-color: #fff3cd !important;
}

.pawmy-warning-badge {
    display: inline-block;
    background-color: #ffc107;
    color: #000;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .pawmy-frontend-table {
        font-size: 12px;
    }
    
    .pawmy-frontend-table th,
    .pawmy-frontend-table td {
        padding: 8px 6px;
    }
    
    .pawmy-frontend-table .pawmy-btn-small {
        padding: 4px 8px;
        font-size: 11px;
        display: block;
        width: 100%;
        margin-bottom: 4px;
        margin-right: 0;
    }
}

/* ========================================
   コンテナ
======================================== */
.pawmy-frontend-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ========================================
   ヘッダー
======================================== */
.pawmy-frontend-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.pawmy-frontend-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pawmy-icon {
    font-size: 32px;
}

.pawmy-frontend-description {
    font-size: 16px;
    margin: 0;
    opacity: 0.95;
}

/* ========================================
   通知・警告
======================================== */
.pawmy-frontend-notice {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.pawmy-notice-warning {
    background-color: #fff8e5;
    border-left: 4px solid #f0ad4e;
}

.pawmy-notice-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.pawmy-notice-content strong {
    display: block;
    margin-bottom: 5px;
    color: #856404;
}

.pawmy-notice-content p {
    margin: 0;
    color: #856404;
}

/* ========================================
   検索・フィルター
======================================== */
.pawmy-frontend-filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.pawmy-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.pawmy-search-box {
    flex: 1;
    min-width: 250px;
    display: flex;
    position: relative;
}

.pawmy-search-input {
    flex: 1;
    padding: 12px 45px 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
}

.pawmy-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pawmy-search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.pawmy-search-button:hover {
    background: #5568d3;
}

.pawmy-sort-box {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pawmy-sort-box label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.pawmy-sort-select,
.pawmy-sort-order {
    padding: 10px 12px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.pawmy-sort-select:focus,
.pawmy-sort-order:focus {
    outline: none;
    border-color: #667eea;
}

.pawmy-sort-button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.pawmy-sort-button:hover {
    background: #5568d3;
}

/* ========================================
   グリッドレイアウト
======================================== */
.pawmy-frontend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* ========================================
   ペットカード
======================================== */
.pawmy-pet-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pawmy-pet-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.pawmy-pet-card.has-warning {
    border: 2px solid #f0ad4e;
}

/* カードヘッダー */
.pawmy-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-bottom: 1px solid #e1e8ed;
}

.pawmy-pet-icon {
    font-size: 40px;
    flex-shrink: 0;
}

.pawmy-pet-name {
    flex: 1;
}

.pawmy-pet-name h3 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.pawmy-warning-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #fff8e5;
    color: #856404;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.pawmy-warning-badge .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* カード本体 */
.pawmy-card-body {
    padding: 20px;
}

.pawmy-card-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #f5f7fa;
}

.pawmy-card-row:last-child {
    border-bottom: none;
}

.pawmy-card-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.pawmy-card-value {
    text-align: right;
    color: #333;
    font-size: 14px;
    word-break: break-word;
    max-width: 60%;
}

.pawmy-number {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 16px;
    color: #667eea;
    letter-spacing: 1px;
}

.pawmy-product-name {
    font-size: 13px;
}

/* カードフッター */
.pawmy-card-footer {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: #f8f9fa;
    border-top: 1px solid #e1e8ed;
}

/* ========================================
   ボタン
======================================== */
.pawmy-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.pawmy-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.pawmy-btn-primary {
    background: #667eea;
    color: white;
}

.pawmy-btn-primary:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

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

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

.pawmy-btn-danger {
    background: #dc3545;
    color: white;
}

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

/* ========================================
   空のstate
======================================== */
.pawmy-frontend-empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pawmy-empty-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 20px;
}

.pawmy-frontend-empty p {
    font-size: 18px;
    color: #666;
    margin: 10px 0;
}

.pawmy-empty-hint {
    font-size: 14px;
    color: #999;
}

/* ========================================
   ページネーション
======================================== */
.pawmy-frontend-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 30px 0;
}

.pawmy-page-link {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.pawmy-page-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pawmy-page-numbers {
    display: flex;
    gap: 6px;
}

.pawmy-page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.pawmy-page-number:hover {
    background: #f5f7fa;
    border-color: #667eea;
}

.pawmy-page-current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ========================================
   データ件数表示
======================================== */
.pawmy-frontend-info {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 20px;
}

.pawmy-frontend-info p {
    margin: 0;
}

/* ========================================
   ログインメッセージ
======================================== */
.pawmy-frontend-login-message {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pawmy-login-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 20px;
}

.pawmy-frontend-login-message h3 {
    font-size: 24px;
    margin: 0 0 10px 0;
    color: #333;
}

.pawmy-frontend-login-message p {
    font-size: 16px;
    color: #666;
    margin: 0 0 20px 0;
}

/* ========================================
   モーダル
======================================== */
.pawmy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.pawmy-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.pawmy-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

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

.pawmy-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.pawmy-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.pawmy-modal-close:hover {
    color: #333;
}

.pawmy-modal-body {
    padding: 20px;
}

.pawmy-modal-description {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.6;
}

.pawmy-request-info {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.pawmy-request-info p {
    margin: 8px 0;
    color: #333;
}

.pawmy-form-group {
    margin-bottom: 16px;
}

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

.pawmy-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.pawmy-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.pawmy-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #e1e8ed;
}

.pawmy-modal-footer .pawmy-btn {
    flex: 1;
}

/* ========================================
   ローディング
======================================== */
.pawmy-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.pawmy-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e1e8ed;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: pawmy-spin 0.8s linear infinite;
}

@keyframes pawmy-spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   レスポンシブ対応
======================================== */
@media (max-width: 768px) {
    .pawmy-frontend-container {
        padding: 16px;
    }
    
    .pawmy-frontend-header {
        padding: 24px 16px;
    }
    
    .pawmy-frontend-title {
        font-size: 22px;
    }
    
    .pawmy-frontend-description {
        font-size: 14px;
    }
    
    .pawmy-frontend-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .pawmy-search-form {
        flex-direction: column;
    }
    
    .pawmy-search-box,
    .pawmy-sort-box {
        width: 100%;
    }
    
    .pawmy-sort-box {
        flex-wrap: wrap;
    }
    
    .pawmy-card-footer {
        flex-direction: column;
    }
    
    .pawmy-page-numbers {
        flex-wrap: wrap;
    }
    
    .pawmy-modal-content {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .pawmy-card-row {
        flex-direction: column;
        gap: 6px;
    }
    
    .pawmy-card-value {
        text-align: left;
        max-width: 100%;
    }
}
