/* ============================================================
   RYTHM — Brand CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ── Custom properties ───────────────────────────────────── */

:root {
    --gradient: linear-gradient(135deg, #FF8C42 0%, #E8589F 55%, #7B5BA6 100%);
    --color-orange:  #FF8C42;
    --color-pink:    #E8589F;
    --color-purple:  #7B5BA6;

    --color-bg:      #F5F7FA;
    --color-surface: #ffffff;
    --color-text:    #1B1F3B;
    --color-subtle:  #6B7280;

    --color-cancel-bg:   #FDE8F0;
    --color-cancel-text: #E8589F;
    --color-done-bg:     #E6F9F1;
    --color-done-text:   #27AE60;
    --color-danger:      #D32F2F;

    --radius-card:   20px;
    --radius-btn:    12px;
    --radius-pill:   100px;
    --shadow-card:   0 4px 20px rgba(0,0,0,0.08);
    --shadow-sm:     0 2px 8px rgba(0,0,0,0.06);
}

/* ── Reset & Base ─────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background: var(--color-bg);
    margin: 0;
    padding: 0;
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-pink);
    font-weight: 500;
    text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ============================================================
   AUTH SCREENS
   ============================================================ */

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
}

.auth-container { text-align: center; }

.auth-logo {
    width: 120px;
    margin-bottom: 25px;
}

.auth-card {
    display: inline-block;
    text-align: left;
    background: var(--color-surface);
    padding: 30px 35px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    min-width: 320px;
}

.auth-card h2 {
    margin-top: 0;
    font-weight: 600;
    font-size: 22px;
}

.auth-card input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #E0E6F0;
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s;
}
.auth-card input:focus { border-color: var(--color-pink); }

.auth-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border-radius: var(--radius-btn);
    background: var(--gradient);
    border: none;
    color: white;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
}
.auth-btn:hover { opacity: 0.9; }

.auth-links {
    margin-top: 14px;
    font-size: 13px;
}
.auth-links a {
    display: block;
    margin-top: 5px;
    color: var(--color-pink);
}

.auth-error   { color: var(--color-danger); font-size: 14px; margin-bottom: 8px; }
.auth-success { color: var(--color-done-text); font-size: 14px; margin-bottom: 8px; }

/* ============================================================
   APP HEADER
   ============================================================ */

.app-header {
    background: var(--color-surface);
    padding: 12px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-logo { height: 38px; }

.app-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.app-user {
    font-weight: 500;
    font-size: 14px;
    color: var(--color-text);
}

.app-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    background: var(--gradient);
    padding: 2px;
}
.app-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.app-avatar-menu {
    position: absolute;
    right: 0;
    top: 48px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 150px;
    z-index: 200;
}
.app-avatar-menu a {
    display: block;
    padding: 9px 16px;
    font-size: 14px;
    color: var(--color-text);
}
.app-avatar-menu a:hover {
    background: var(--color-bg);
    text-decoration: none;
}
.app-avatar-menu hr {
    border: none;
    border-top: 1px solid #EEF0F5;
    margin: 6px 0;
}
.app-avatar-menu .menu-section {
    display: block;
    padding: 4px 16px 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--color-subtle);
}

/* Mobile user cards (admin_users) */
.user-cards { display: none; }
@media (max-width: 600px) {
    .table-wrapper { display: none; }
    .user-cards    { display: flex; flex-direction: column; gap: 12px; }
}
.user-card {
    background: var(--color-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.user-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.user-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
}
.user-card-meta {
    font-size: 12px;
    color: var(--color-subtle);
    margin-top: 2px;
}

/* ============================================================
   PAGE BANNER (gradient strip — tasks + future pages)
   ============================================================ */

.page-banner {
    background: var(--gradient);
    padding: 28px 20px 22px;
    text-align: center;
}

.page-banner-title {
    color: white;
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 18px;
    letter-spacing: -0.3px;
}

/* ── Campaign filter pills ───────────────────────────────── */

.campaign-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.campaign-pill {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1.5px solid rgba(255,255,255,0.4);
    padding: 7px 20px;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.campaign-pill:hover,
.campaign-pill.active {
    background: rgba(255,255,255,0.35);
    border-color: rgba(255,255,255,0.8);
}

/* ============================================================
   LAYOUT + CARDS (general)
   ============================================================ */

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 540px;
    margin: 30px auto;
    padding: 0 16px;
}

.card {
    background: var(--color-surface);
    padding: 25px 30px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}
.card h2 {
    margin-top: 0;
    font-weight: 600;
    color: var(--color-text);
}

/* ── Hero card (dashboard) ───────────────────────────────── */

.hero-card {
    text-align: center;
    padding: 60px 30px;
    color: white;
    border-radius: var(--radius-card);
    background: var(--gradient);
    position: relative;
    overflow: hidden;
}
.hero-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.15);
}
.hero-card > * { position: relative; z-index: 2; }

.hero-title    { margin: 0; font-size: 32px; font-weight: 700; }
.hero-subtitle { margin-top: 10px; font-size: 18px; opacity: 0.9; }

/* ============================================================
   BUTTONS (general)
   ============================================================ */

.btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-btn);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.88; }
.btn:disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }

.btn.danger { background: var(--color-danger); }
.btn.danger:hover { opacity: 0.85; }

/* ============================================================
   CONTACT CARDS (tasks page)
   ============================================================ */

.contact-card {
    background: var(--color-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 20px;
    margin-bottom: 16px;
    border: 1.5px solid #F0F0F5;
    transition: transform 0.15s;
    overflow: hidden;
}
.contact-card:active { transform: scale(0.99); }

/* Avatar + name row */
.contact-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.contact-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: #F0D4E6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: var(--color-pink);
    letter-spacing: 0.5px;
}
.contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.contact-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* LinkedIn button */
.btn-linkedin {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-btn);
    background: var(--gradient);
    color: white;
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    border: none;
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 12px;
    transition: opacity 0.2s;
}
.btn-linkedin:hover { opacity: 0.88; text-decoration: none; color: white; }
.btn-linkedin.no-url {
    background: #E0E6F0;
    color: var(--color-subtle);
    cursor: default;
}

/* Cancel + Complete row */
.contact-actions {
    display: flex;
    gap: 10px;
}

.btn-cancel,
.btn-complete {
    flex: 1;
    padding: 11px 10px;
    border-radius: var(--radius-btn);
    border: 1.5px dashed;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: opacity 0.2s, transform 0.1s;
}
.btn-cancel:hover,
.btn-complete:hover { opacity: 0.82; transform: scale(0.98); }

.btn-cancel {
    background: var(--color-cancel-bg);
    color: var(--color-cancel-text);
    border-color: var(--color-cancel-text);
}
.btn-complete {
    background: var(--color-done-bg);
    color: var(--color-done-text);
    border-color: var(--color-done-text);
}

.action-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px dashed currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}
.btn-complete .action-icon {
    border-style: solid;
    background: var(--color-done-text);
    color: white;
    font-size: 10px;
}

/* ── Card action animations ─────────────────────────────── */

@keyframes flash-complete {
    0%   { background: var(--color-surface); }
    40%  { background: #D4FAEB; border-color: var(--color-done-text); }
    100% { background: #D4FAEB; }
}
@keyframes flash-cancel {
    0%   { background: var(--color-surface); }
    40%  { background: #FADADD; border-color: var(--color-cancel-text); }
    100% { background: #FADADD; }
}

.card-completing { animation: flash-complete 0.45s ease forwards; }
.card-cancelling { animation: flash-cancel  0.45s ease forwards; }

/* ── Empty / celebration state ───────────────────────────── */

.tasks-empty {
    text-align: center;
    padding: 50px 20px;
}
.tasks-empty h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 6px;
}
.tasks-empty p {
    font-size: 18px;
    color: var(--color-subtle);
    margin: 0 0 24px;
}
.tasks-empty img {
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    margin-bottom: 24px;
}

/* ── Last updated note ───────────────────────────────────── */

.tasks-meta {
    font-size: 13px;
    color: var(--color-subtle);
    text-align: center;
    margin-bottom: 20px;
}

/* ============================================================
   TABLES (admin pages)
   ============================================================ */

.table-wrapper { overflow-x: auto; width: 100%; }

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
th {
    background: var(--gradient);
    color: white;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}
td {
    padding: 12px 14px;
    border-bottom: 1px solid #E0E6F0;
    font-size: 14px;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #F9F0FF; }

/* ============================================================
   ADMIN SECTIONS
   ============================================================ */

.admin-section     { border-left: 4px solid var(--color-orange); }
.superadmin-section { border-left: 4px solid var(--color-danger); }

.logout-small { color: var(--color-danger); font-weight: 600; }

/* ============================================================
   FORMS (inputs used in app pages)
   ============================================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
input[type="date"],
select {
    padding: 8px 12px;
    border: 1.5px solid #E0E6F0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 8px;
    outline: none;
    transition: border-color 0.2s;
}
input:focus, select:focus { border-color: var(--color-pink); }

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 600px) {
    .auth-card {
        min-width: 280px;
        padding: 24px 20px;
    }

    .container, .container-narrow {
        padding: 0 12px;
        margin-top: 20px;
    }

    .app-header { padding: 10px 15px; }
    .app-user   { display: none; }

    .page-banner-title { font-size: 20px; }

    .contact-name { font-size: 17px; }

    .hero-title    { font-size: 24px; }
    .hero-subtitle { font-size: 15px; }
}
