/* css/relationships.css */

/* --- Header (Standardized) --- */
.cal-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 14px; /* Accessing global variable might be tricky in pure CSS file, using fix value matching main layout padding */
    padding-right: 14px;
    padding-top: 15px;
    border-bottom: none;
    flex-shrink: 0;
    background: transparent; /* Let app background show */
}

@media (max-width: 768px) {
    .cal-header {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* --- Layout & Grid --- */
.relationships-container {
    padding: 0 2rem 6rem 2rem; /* Adjusted top padding since header is separate */
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease-out;
}

/* Remove old header styles */
/* .relationships-header { ... } */
/* .header-title h1 { ... } */

/* --- Search & Filter Bar --- */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1rem; /* Space from header */
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.search-wrapper svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--color-secondary-text);
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--color-input-bg);
    border: 1px solid var(--color-highlight);
    border-radius: 12px;
    color: var(--color-primary-text);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.1);
}

.filter-tags {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 4px;
}

.filter-chip {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: var(--color-panel-bg);
    border: 1px solid var(--color-highlight);
    color: var(--color-secondary-text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-chip:hover {
    background: var(--color-highlight);
    color: var(--color-primary-text);
}

.filter-chip.active {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

/* --- Cards Grid --- */
.relationships-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* --- Contact Card --- */
.contact-card {
    background: rgba(var(--color-panel-bg-rgb), 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-highlight);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.2);
    border-color: var(--color-accent);
}

/* Health Indicator (Glow) */
.health-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    z-index: 2;
}

.health-good { background: #10B981; box-shadow: 0 0 8px #10B981; }
.health-warning { background: #F59E0B; box-shadow: 0 0 8px #F59E0B; }
.health-bad { background: #EF4444; box-shadow: 0 0 8px #EF4444; }

/* Avatar Area */
.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--color-highlight), var(--color-input-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary-text);
    border: 2px solid var(--color-highlight);
    flex-shrink: 0;
}

.card-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary-text);
    margin-bottom: 0.2rem;
}

.card-role {
    font-size: 0.8rem;
    color: var(--color-accent);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card Body */
.card-stats {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-top: 1px solid var(--color-highlight);
    border-bottom: 1px solid var(--color-highlight);
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--color-secondary-text);
    margin-bottom: 0.2rem;
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-primary-text);
}

/* Card Footer (Tags) */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: var(--color-highlight);
    color: var(--color-secondary-text);
    border-radius: 6px;
}

/* Action Button (Hidden by default, shows on hover) */
.log-btn {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.6rem;
    border-radius: 8px;
    background: var(--color-accent);
    color: white;
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    opacity: 0; 
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.contact-card:hover .log-btn {
    opacity: 1;
    transform: translateY(0);
}

/* Add Button FAB (Retained for mobile or if header button is hidden) */
.fab-add {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(var(--color-accent-rgb), 0.4);
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 100;
}

.fab-add:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(var(--color-accent-rgb), 0.5);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .relationships-container {
        padding: 1rem;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-wrapper {
        min-width: 100%;
    }
}
