/* =========================================
   AI GUARDIAN — SAFETY CIRCLE
   Page-specific styles only.
   Global reset, body, and layout are
   handled by app-shell.css.
========================================= */

:root {
    --pink: #ff1456;
    --pink-dark: #e90047;
    --pink-light: #fff0f4;
    --pink-soft: #fff7f9;

    --text: #202027;
    --text-light: #777783;

    --border: #f0dce3;
    --background: #fffafb;
    --white: #ffffff;

    --green: #13a456;
    --green-bg: #eaf9f0;
}


/* =========================================
   PAGE
========================================= */

/* ag-content already provides 24px padding;
   page-content adds bottom spacing only. */
.page-content {
    padding: 0 0 40px;
}


/* Heading */

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    margin-bottom: 28px;
}

.eyebrow {
    display: flex;
    align-items: center;

    gap: 7px;

    color: var(--pink);

    font-size: 12px;
    font-weight: 700;

    letter-spacing: 0.3px;

    margin-bottom: 7px;
}

.eyebrow svg {
    width: 15px;
    height: 15px;
}

.page-heading h1 {
    font-size: 27px;

    line-height: 1.2;

    font-weight: 800;

    color: #25242b;

    margin-bottom: 7px;
}

.page-heading p {
    color: #77727a;

    font-size: 12px;

    line-height: 1.5;
}


/* Add Contact */

.add-contact-btn {
    border: none;

    background: var(--pink);

    color: white;

    height: 38px;

    padding: 0 18px;

    border-radius: 10px;

    font-family: inherit;

    font-size: 11px;
    font-weight: 700;

    display: flex;
    align-items: center;

    gap: 7px;

    cursor: pointer;

    box-shadow: 0 6px 18px rgba(255, 20, 86, 0.2);

    transition: 0.2s;
}

.add-contact-btn:hover {
    background: var(--pink-dark);

    transform: translateY(-1px);
}

.add-contact-btn svg {
    width: 15px;
    height: 15px;
}


/* =========================================
   FILTER PANEL
========================================= */

.filter-panel {
    background: white;

    border: 1px solid var(--border);

    border-radius: 12px;

    padding: 12px;

    display: flex;
    align-items: center;

    gap: 12px;

    margin-bottom: 20px;

    box-shadow: 0 2px 8px rgba(50, 20, 30, 0.02);
}


/* Search */

.search-container {
    height: 36px;

    flex: 1;

    position: relative;

    display: flex;
    align-items: center;
}

.search-container svg {
    position: absolute;

    left: 12px;

    width: 15px;
    height: 15px;

    color: #aaa1a7;
}

.search-container input {
    width: 100%;
    height: 100%;

    border: 1px solid #eadfe3;

    background: #fffafd;

    border-radius: 8px;

    outline: none;

    padding: 0 12px 0 35px;

    font-family: inherit;

    font-size: 11px;

    color: #333;
}

.search-container input::placeholder {
    color: #aaa2a8;
}

.search-container input:focus {
    border-color: #ffb1c5;

    box-shadow: 0 0 0 3px rgba(255, 20, 86, 0.05);
}


/* Filters */

.category-filter {
    display: flex;

    gap: 5px;
}

.filter-btn {
    height: 31px;

    padding: 0 12px;

    border: none;

    background: transparent;

    color: #77717a;

    border-radius: 7px;

    font-family: inherit;

    font-size: 10px;
    font-weight: 500;

    cursor: pointer;

    transition: 0.2s;
}

.filter-btn:hover {
    background: #fff0f4;

    color: var(--pink);
}

.filter-btn.active {
    background: #fff0f4;

    color: var(--pink);

    font-weight: 700;
}


/* =========================================
   CONTACT GRID
========================================= */

.contacts-grid {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 18px;
}


/* =========================================
   CONTACT CARD
========================================= */

.contact-card {
    background: white;

    border: 1px solid var(--border);

    border-radius: 13px;

    padding: 17px;

    min-height: 270px;

    box-shadow: 0 5px 18px rgba(50, 20, 30, 0.035);

    transition: 0.25s ease;
}

.contact-card:hover {
    transform: translateY(-2px);

    border-color: #f4c5d2;

    box-shadow: 0 8px 25px rgba(255, 20, 86, 0.08);
}


/* Card Top */

.card-top {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 14px;
}

.person {
    display: flex;

    align-items: center;

    gap: 10px;
}

.person-avatar {
    width: 38px;
    height: 38px;

    border-radius: 10px;

    background: var(--pink);

    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 11px;
    font-weight: 800;
}

.person h3 {
    font-size: 13px;

    font-weight: 700;

    color: #29272e;

    margin-bottom: 3px;
}

.person span {
    font-size: 9px;

    color: #8d858c;
}


/* Status */

.status {
    background: var(--green-bg);

    color: var(--green);

    font-size: 9px;
    font-weight: 700;

    padding: 5px 9px;

    border-radius: 20px;
}


/* =========================================
   CONTACT DETAILS
========================================= */

.contact-details {
    background: #fff6f8;

    border-radius: 8px;

    padding: 8px 10px;

    margin-bottom: 13px;
}

.contact-details div {
    display: flex;
    align-items: center;

    gap: 7px;

    font-size: 10px;

    color: #4c4850;

    margin: 3px 0;
}

.contact-details svg {
    width: 12px;
    height: 12px;

    color: var(--pink);
}


/* =========================================
   SETTINGS
========================================= */

.settings-row {
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    font-size: 10px;

    color: #57525a;

    border-bottom: 1px solid #f5edf0;
}

.settings-row:last-of-type {
    border-bottom: none;
}


/* =========================================
   TOGGLE
========================================= */

.switch {
    position: relative;

    width: 36px;
    height: 20px;

    display: inline-block;
}

.switch input {
    opacity: 0;

    width: 0;
    height: 0;
}

.slider {
    position: absolute;

    inset: 0;

    cursor: pointer;

    background: #ddd8db;

    border-radius: 20px;

    transition: 0.25s;
}

.slider::before {
    content: "";

    position: absolute;

    width: 14px;
    height: 14px;

    left: 3px;
    top: 3px;

    background: white;

    border-radius: 50%;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);

    transition: 0.25s;
}

.switch input:checked + .slider {
    background: var(--pink);
}

.switch input:checked + .slider::before {
    transform: translateX(16px);
}


/* =========================================
   CARD FOOTER
========================================= */

.card-footer {
    display: flex;

    align-items: center;
    justify-content: space-between;

    padding-top: 12px;
}

.test-alert {
    border: none;

    background: transparent;

    color: #77717a;

    font-family: inherit;

    font-size: 10px;

    display: flex;
    align-items: center;

    gap: 6px;

    cursor: pointer;
}

.test-alert:hover {
    color: var(--pink);
}

.test-alert svg {
    width: 13px;
    height: 13px;
}


.card-actions {
    display: flex;

    gap: 10px;
}

.card-actions button {
    border: none;

    background: transparent;

    cursor: pointer;

    padding: 3px;

    color: #99929a;
}

.card-actions button:hover {
    color: var(--pink);
}

.card-actions svg {
    width: 14px;
    height: 14px;
}

.card-actions .delete-btn:hover {
    color: #e60045;
}


/* =========================================
   MODAL
========================================= */

.modal-overlay {
    position: fixed;

    inset: 0;

    background: rgba(30, 20, 25, 0.25);

    backdrop-filter: blur(3px);

    display: none;

    align-items: center;
    justify-content: center;

    z-index: 100;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: 420px;

    background: white;

    border-radius: 15px;

    border: 1px solid var(--border);

    box-shadow: 0 20px 60px rgba(30, 10, 20, 0.15);

    padding: 22px;

    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;

    justify-content: space-between;

    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 18px;

    color: #25232a;

    margin-bottom: 5px;
}

.modal-header p {
    font-size: 10px;

    color: #888188;
}

.close-modal {
    border: none;

    background: #fff2f5;

    color: var(--pink);

    width: 30px;
    height: 30px;

    border-radius: 8px;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
}

.close-modal svg {
    width: 16px;
    height: 16px;
}


/* Form */

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;

    font-size: 10px;

    font-weight: 600;

    margin-bottom: 6px;

    color: #4e4950;
}

.form-group input,
.form-group select {
    width: 100%;

    height: 37px;

    border: 1px solid #eadde2;

    border-radius: 8px;

    outline: none;

    padding: 0 11px;

    font-family: inherit;

    font-size: 11px;

    background: #fffafb;

    color: #333;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #ff9db7;

    box-shadow: 0 0 0 3px rgba(255, 20, 86, 0.05);
}


/* Modal Buttons */

.modal-buttons {
    display: flex;

    justify-content: flex-end;

    gap: 8px;

    margin-top: 20px;
}

.cancel-btn,
.save-btn {
    height: 36px;

    padding: 0 15px;

    border-radius: 8px;

    font-family: inherit;

    font-size: 10px;

    font-weight: 600;

    cursor: pointer;
}

.cancel-btn {
    border: 1px solid #eadde2;

    background: white;

    color: #77717a;
}

.save-btn {
    border: none;

    background: var(--pink);

    color: white;
}

.save-btn:hover {
    background: var(--pink-dark);
}


/* =========================================
   HIDDEN CARD
========================================= */

.contact-card.hidden {
    display: none;
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1100px) {

    .contacts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .category-filter {
        justify-content: flex-start;
        overflow-x: auto;
    }
}


@media (max-width: 750px) {

    .page-heading {
        flex-direction: column;

        gap: 18px;
    }

    .contacts-grid {
        grid-template-columns: 1fr;
    }

    .add-contact-btn {
        width: 100%;

        justify-content: center;
    }
}


@media (max-width: 500px) {

    .page-content {
        padding: 20px 15px;
    }

    .page-heading h1 {
        font-size: 23px;
    }

    .category-filter {
        flex-wrap: wrap;
    }

    .modal {
        width: calc(100% - 30px);
    }
}