/* --- Variables --- */
:root {
    --cm-primary: #667eea;
    --cm-secondary: #764ba2;
    --cm-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --cm-bg-overlay: rgba(0, 0, 0, 0.6);
    --cm-bg-card: #ffffff;
    --cm-text-main: #333;
    --cm-text-sub: #666;
    --cm-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* --- Modal Overlay --- */
.contact-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--cm-bg-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10001;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.contact-modal-overlay.show {
    display: flex;
    opacity: 1;
}

/* --- Modal Container --- */
.contact-modal-container {
    background: #f4f7f6;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.contact-modal-overlay.show .contact-modal-container {
    transform: scale(1);
}

/* --- Header --- */
.cm-header {
    background: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cm-title {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--cm-text-main);
}

.cm-title i {
    background: var(--cm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 26px;
}

.cm-close-btn {
    background: #f1f3f5;
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 20px;
    color: #888;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease;
}

.cm-close-btn:hover {
    background: #ff4757;
    color: white;
    transform: rotate(90deg);
}

/* --- Body & Grid --- */
.cm-body {
    padding: 30px;
    overflow-y: auto;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
}

.cm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

/* --- Admin Card Design --- */
.cm-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(255,255,255,0.8);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.5s forwards;
}

.cm-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.15);
    background: white;
}

/* Avatar */
.cm-avatar-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.cm-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--cm-gradient);
    padding: 3px; /* Border gradient width */
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25);
}

.cm-avatar-inner {
    width: 100%; height: 100%;
    background: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--cm-primary);
    text-transform: uppercase;
}

.cm-status-dot {
    position: absolute;
    bottom: 5px; right: 5px;
    width: 14px; height: 14px;
    background: #2ecc71;
    border: 2px solid white;
    border-radius: 50%;
}

/* Info */
.cm-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--cm-text-main);
    margin-bottom: 5px;
}

.cm-role {
    font-size: 13px;
    color: var(--cm-secondary);
    background: rgba(118, 75, 162, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
    margin-bottom: 20px;
}

/* Contact List */
.cm-contact-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cm-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: #f8fafc;
    border-radius: 12px;
    transition: 0.2s;
    text-decoration: none;
    color: var(--cm-text-main);
    font-size: 14px;
}

.cm-contact-item:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transform: translateX(5px);
}

.cm-icon-box {
    width: 32px; height: 32px;
    background: white;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--cm-primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.cm-contact-info {
    display: flex;
    flex-direction: column;
}

.cm-label {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.cm-value {
    font-weight: 500;
    word-break: break-all;
}

/* Loading & Empty States */
.cm-loading, .cm-empty {
    text-align: center;
    padding: 50px 20px;
    color: #999;
    width: 100%;
    grid-column: 1 / -1;
}

.cm-loading i, .cm-empty i {
    font-size: 40px;
    margin-bottom: 15px;
    opacity: 0.5;
    display: block;
}

/* Animation Keyframes */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 600px) {
    .cm-grid { grid-template-columns: 1fr; }
    .cm-header { padding: 15px 20px; }
    .cm-body { padding: 20px; }
}
.btn-delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s;
    font-family: 'Kanit', sans-serif;
    font-size: 14px;
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.btn-delete:active {
    transform: translateY(0);
}