/* Modern Agency Card Design - CSP Compliant External Stylesheet */

/* Modern Design Preview Banner */
.modern-design-preview-banner {
    background: rgba(255, 238, 0, 0.1);
    border: 2px solid #ffee00;
    padding: 1rem;
    margin: 2rem 0;
    border-radius: 8px;
    text-align: center;
}

.modern-design-preview-banner h3 {
    color: #ffee00;
    margin-bottom: 0.5rem;
}

.modern-design-preview-banner p {
    color: #fff;
}

/* Modern Agency Card */
.agency-card-modern {
    background: #000000 !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 238, 0, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.agency-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #009b3a, #ffee00);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.agency-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(255, 238, 0, 0.2);
    border-color: rgba(255, 238, 0, 0.6);
}

.agency-card-modern:hover::before {
    opacity: 1;
}

/* Reference ID Badge */
.agency-card-modern .ref-id-badge {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #ffee00;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    color: #ffee00;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Badge positioning - synchronized with reference-id-badges.css */
.agency-card-modern .ref-id-badge.ref-id-top-right {
    top: 75px;
    right: 35px;
    position: absolute;
}

.agency-card-modern .ref-id-badge:hover {
    background: rgba(255, 238, 0, 0.2);
    border-color: #ffee00;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(255, 238, 0, 0.4);
}

.agency-card-modern .ref-id-badge.copied {
    background: rgba(40, 167, 69, 0.25);
    border-color: #28a745;
    animation: copyPulse 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes copyPulse {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.05); }
}

/* Badges Container - Flexbox for side-by-side badges (OPTION A: HTML Refactoring - ACTIVE) */
.agency-card-modern .badges-container {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;  /* Changed to vertical stack */
    align-items: flex-end;   /* Align to right edge */
    gap: 4px;                /* Reduced for vertical spacing */
    z-index: 100;
}

/*
 * OPTION B: CSS Absolute Positioning (Alternative - NOT ACTIVE)
 * Use this if reverting to original HTML structure (badges in separate parents)
 *
 * .agency-card-modern {
 *     position: relative;
 * }
 *
 * .agency-card-modern .ref-id-badge {
 *     position: absolute;
 *     top: 12px;
 *     right: 12px;
 *     z-index: 101;
 * }
 *
 * .agency-card-modern .status-badge {
 *     position: absolute;
 *     top: 12px;
 *     right: 140px;
 *     z-index: 100;
 * }
 */

/* Card Header */
.agency-card-modern .card-header {
    margin-bottom: 1rem;
    text-align: center;
}

.agency-card-modern .card-title-section {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;  /* NOBARA FIX (Tier 3 TS-20260103-130500): Enable text overflow protection */
}

.agency-card-modern .agency-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
    text-align: center;
    width: 100%;
    /* P1-3 FIX: Text overflow protection (Megumi Diagnostic 2026-01-03) */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* P1-3 FIX: Text overflow protection for agency description (Megumi Diagnostic 2026-01-03) */
.agency-card-modern .agency-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* P1-3 FIX: Text overflow protection for contact and address (Megumi Diagnostic 2026-01-03) */
.agency-card-modern .agency-contact,
.agency-card-modern .agency-address {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agency-card-modern .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    cursor: default;
}

.agency-card-modern .status-badge.approved {
    background: #28a745;
    color: #ffffff;
    border: 1px solid #28a745;
}

.agency-card-modern .status-badge.pending {
    background: rgba(255, 207, 64, 0.2);
    color: #ffcf40;
    border: 1px solid #ffcf40;
}

.agency-card-modern .status-badge.exception {
    background: rgba(74, 144, 226, 0.2);
    color: #4a90e2;
    border: 1px solid #4a90e2;
}

/* Status Badge Hover Effects */
.agency-card-modern .status-badge:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.agency-card-modern .status-badge.approved:hover {
    background: #2ecc54;
    border-color: #2ecc54;
}

.agency-card-modern .status-badge.pending:hover {
    background: rgba(255, 207, 64, 0.3);
    border-color: #ffcf40;
}

.agency-card-modern .status-badge.exception:hover {
    background: rgba(74, 144, 226, 0.3);
    border-color: #4a90e2;
}

/* Rating Section */
.agency-card-modern .rating-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.agency-card-modern .stars {
    display: flex;
    gap: 0.25rem;
}

.agency-card-modern .star {
    color: #ffee00;
    font-size: 1rem;
}

.agency-card-modern .star.empty {
    color: rgba(255, 238, 0, 0.3);
}

.agency-card-modern .rating-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffee00;
}

.agency-card-modern .rating-count {
    font-size: 0.85rem;
    color: #aaa;
}

/* Info Grid */
.agency-card-modern .info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.agency-card-modern .info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.agency-card-modern .info-icon {
    color: #009b3a;
    margin-top: 0.25rem;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.agency-card-modern .info-content {
    flex: 1;
    min-width: 0;
}

.agency-card-modern .info-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.agency-card-modern .info-value {
    font-size: 0.9rem;
    color: #fff;
    word-wrap: break-word;
}

.agency-card-modern .info-value a {
    color: #4a90e2;
    text-decoration: none;
    transition: color 0.2s;
}

.agency-card-modern .info-value a:hover {
    color: #ffee00;
    text-decoration: underline;
}

.agency-card-modern .info-value.not-found {
    color: #666;
    font-style: italic;
}

.agency-card-modern .location-tag {
    background: rgba(0, 155, 58, 0.2);
    color: #28a745;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    border: 1px solid #28a745;
}

/* Quick Actions */
.agency-card-modern .quick-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.agency-card-modern:hover .quick-actions {
    opacity: 1;
    transform: translateY(0);
}

.agency-card-modern .action-btn {
    flex: 1;
    padding: 0.65rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.agency-card-modern .action-btn.primary {
    background: linear-gradient(135deg, #009b3a, #28a745);
    color: white;
}

.agency-card-modern .action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 155, 58, 0.4);
}

.agency-card-modern .action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffee00;
    border: 1px solid rgba(255, 238, 0, 0.3);
}

.agency-card-modern .action-btn.secondary:hover {
    background: rgba(255, 238, 0, 0.2);
    border-color: #ffee00;
}

/* Responsive */
@media (max-width: 768px) {
    .agency-card-modern .info-grid {
        grid-template-columns: 1fr;
    }

    .agency-card-modern .quick-actions {
        flex-direction: column;
    }

    /* Responsive Badges Container */
    .agency-card-modern .badges-container {
        top: 8px;
        right: 8px;
        gap: 3px;
        flex-wrap: wrap;
        max-width: calc(100% - 16px);
    }

    .agency-card-modern .status-badge,
    .agency-card-modern .ref-id-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
        gap: 4px;
    }

    .agency-card-modern .ref-id-copy-icon {
        font-size: 0.8em;
    }
}
