/* ============================================
   Field Masters (FM) - フィールドマスターズ
   ============================================ */

/* FM Stats Summary */
.fm-stats-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.fm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.fm-stat-item {
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.fm-stat-value {
    font-size: 32px;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

.fm-stat-label {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 500;
}

/* FM Grid Container */
.fm-grid-container {
    margin-top: 24px;
}

.fm-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.fm-grid-title {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
}

.fm-grid-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.fm-filter-btn,
.fm-sort-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
}

.fm-filter-btn:hover,
.fm-sort-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f7fafc;
}

.fm-filter-btn.active,
.fm-sort-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* FM Grid */
.fm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* FM Card */
.fm-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.fm-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.fm-card-image-container {
    position: relative;
    width: 100%;
    padding-top: 100%;
    /* 1:1 aspect ratio */
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    overflow: hidden;
}

.fm-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fm-card-status-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.fm-card-status-badge.approved {
    background: rgba(72, 187, 120, 0.9);
    color: white;
}

.fm-card-status-badge.pending {
    background: rgba(237, 137, 54, 0.9);
    color: white;
}

.fm-card-status-badge.excellent {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* FM Card Content */
.fm-card-content {
    padding: 16px;
}

.fm-card-bird-name {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fm-card-score {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.fm-card-score-icon {
    font-size: 18px;
}

.fm-card-score-value {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

.fm-card-score-max {
    font-size: 14px;
    color: #a0aec0;
}

.fm-card-points {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.fm-card-points-icon {
    font-size: 16px;
}

.fm-card-points-value {
    font-size: 16px;
    font-weight: 600;
    color: #f6ad55;
}

.fm-card-breakdown {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: #718096;
    margin-bottom: 12px;
}

.fm-card-breakdown-item {
    display: flex;
    align-items: center;
    gap: 2px;
}

.fm-card-action {
    width: 100%;
    padding: 10px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.fm-card-action:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.fm-card-action.update {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Pending Card */
.fm-card.pending .fm-card-content {
    text-align: center;
}

.fm-card-pending-info {
    font-size: 14px;
    color: #718096;
    margin-bottom: 8px;
}

.fm-card-pending-count {
    font-size: 24px;
    font-weight: 700;
    color: #ed8936;
    margin-bottom: 4px;
}

/* New Submission Card */
.fm-card.new-submission {
    border: 3px dashed #cbd5e0;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.fm-card.new-submission:hover {
    border-color: #667eea;
    background: #edf2f7;
}

.fm-new-submission-content {
    text-align: center;
    padding: 24px;
}

.fm-new-submission-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.fm-new-submission-text {
    font-size: 16px;
    font-weight: 600;
    color: #4a5568;
}

/* FM Detail Modal */
.fm-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.fm-detail-modal.active {
    opacity: 1;
    pointer-events: all;
}

.fm-detail-content {
    background: white;
    border-radius: 24px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.fm-detail-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.fm-detail-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.fm-detail-image-container {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    background: #000;
}

.fm-detail-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fm-detail-body {
    padding: 32px;
}

.fm-detail-bird-name {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 16px;
}

.fm-detail-score-section {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.fm-detail-score-title {
    font-size: 16px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 12px;
    text-align: center;
}

.fm-detail-score-value {
    font-size: 48px;
    font-weight: 700;
    color: #667eea;
    text-align: center;
    margin-bottom: 8px;
}

.fm-detail-score-breakdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.fm-detail-breakdown-item {
    text-align: center;
    padding: 12px;
    background: white;
    border-radius: 12px;
}

.fm-detail-breakdown-symbol {
    font-size: 24px;
    margin-bottom: 4px;
}

.fm-detail-breakdown-count {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
}

.fm-detail-breakdown-label {
    font-size: 12px;
    color: #718096;
}

.fm-detail-points-section {
    background: linear-gradient(135deg, #fef5e7 0%, #fdebd0 100%);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.fm-detail-points-title {
    font-size: 16px;
    font-weight: 600;
    color: #744210;
    margin-bottom: 12px;
}

.fm-detail-points-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.fm-detail-points-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
}

.fm-detail-points-label {
    font-size: 14px;
    color: #4a5568;
}

.fm-detail-points-value {
    font-size: 18px;
    font-weight: 700;
    color: #f6ad55;
}

.fm-detail-comments-section {
    margin-bottom: 24px;
}

.fm-detail-comments-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.fm-detail-comment {
    padding: 16px;
    background: #f7fafc;
    border-radius: 12px;
    margin-bottom: 12px;
}

.fm-detail-comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.fm-detail-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.fm-detail-comment-user {
    font-weight: 600;
    color: #2d3748;
}

.fm-detail-comment-verdict {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
}

.fm-detail-comment-verdict.perfect {
    background: #c6f6d5;
    color: #22543d;
}

.fm-detail-comment-verdict.good {
    background: #bee3f8;
    color: #2c5282;
}

.fm-detail-comment-verdict.uncertain {
    background: #feebc8;
    color: #7c2d12;
}

.fm-detail-comment-verdict.incorrect {
    background: #fed7d7;
    color: #742a2a;
}

.fm-detail-comment-text {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.6;
}

.fm-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 12px;
    margin-bottom: 24px;
}

.fm-detail-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fm-detail-meta-icon {
    font-size: 18px;
}

.fm-detail-meta-text {
    font-size: 14px;
    color: #4a5568;
}

.fm-detail-actions {
    display: flex;
    gap: 12px;
}

.fm-detail-action-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.fm-detail-action-btn.primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.fm-detail-action-btn.primary:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.fm-detail-action-btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.fm-detail-action-btn.secondary:hover {
    background: #cbd5e0;
}

/* Responsive */
@media (max-width: 768px) {
    .fm-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .fm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .fm-detail-score-breakdown {
        grid-template-columns: repeat(2, 1fr);
    }

    .fm-detail-points-grid {
        grid-template-columns: 1fr;
    }

    .fm-detail-meta {
        grid-template-columns: 1fr;
    }

    .fm-detail-body {
        padding: 20px;
    }
}

/* Evaluation Page Styles */
.fm-evaluation-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.fm-evaluation-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.fm-evaluation-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.fm-evaluation-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.fm-evaluation-grid {
    display: grid;
    gap: 24px;
}

.fm-evaluation-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.fm-evaluation-bird-info {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e2e8f0;
}

.fm-evaluation-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
}

.fm-evaluation-details {
    flex: 1;
}

.fm-evaluation-bird-name {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.fm-evaluation-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #718096;
    font-size: 14px;
}

.fm-evaluation-status {
    display: inline-block;
    padding: 6px 12px;
    background: #fef5e7;
    color: #f6ad55;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    margin-top: 12px;
}

.fm-evaluation-form {
    margin-top: 24px;
}

.fm-evaluation-form-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 16px;
}

.fm-verdict-options {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.fm-verdict-option {
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.fm-verdict-option:hover {
    border-color: #667eea;
    background: #f7fafc;
}

.fm-verdict-option.selected {
    border-color: #667eea;
    background: #edf2f7;
}

.fm-verdict-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.fm-verdict-symbol {
    font-size: 24px;
}

.fm-verdict-name {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
}

.fm-verdict-points {
    margin-left: auto;
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
}

.fm-verdict-description {
    font-size: 14px;
    color: #718096;
    line-height: 1.6;
}

.fm-comment-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 20px;
}

.fm-comment-input:focus {
    outline: none;
    border-color: #667eea;
}

.fm-submit-evaluation-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.fm-submit-evaluation-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.fm-submit-evaluation-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}