/*
Theme Name: Personal Dashboard
Theme URI: https://dataflows.co/
Author: KK
Author URI: https://dataflows.co/
Description: A highly secure, minimalist custom WordPress theme that acts as a private personal dashboard. The entire site is locked down to logged-in users only. Includes a Credit Card custom post type and a front-end spend tracker with AJAX updates.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: personal-dashboard
*/

/* ==========================================================================
   Base / Reset
   ========================================================================== */
:root {
    --pd-bg: #0f172a;          /* slate-900 */
    --pd-surface: #1e293b;     /* slate-800 */
    --pd-surface-2: #334155;   /* slate-700 */
    --pd-border: #334155;
    --pd-text: #e2e8f0;        /* slate-200 */
    --pd-muted: #94a3b8;       /* slate-400 */
    --pd-accent: #6366f1;      /* indigo-500 */
    --pd-accent-hover: #4f46e5;/* indigo-600 */
    --pd-success: #22c55e;     /* green-500 */
    --pd-warn: #f59e0b;        /* amber-500 */
    --pd-radius: 14px;
    --pd-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body.personal-dashboard {
    background: var(--pd-bg);
    color: var(--pd-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--pd-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==========================================================================
   Login screen (front-page.php)
   ========================================================================== */
.pd-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.pd-login-card {
    width: 100%;
    max-width: 380px;
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius);
    box-shadow: var(--pd-shadow);
    padding: 36px 32px;
}

.pd-login-card h1 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.pd-login-card .pd-sub {
    margin: 0 0 24px;
    color: var(--pd-muted);
    font-size: 14px;
}

.pd-field { margin-bottom: 16px; }
.pd-field label {
    display: block;
    font-size: 13px;
    color: var(--pd-muted);
    margin-bottom: 6px;
}
.pd-field input[type="text"],
.pd-field input[type="password"] {
    width: 100%;
    padding: 11px 13px;
    background: var(--pd-bg);
    border: 1px solid var(--pd-border);
    border-radius: 10px;
    color: var(--pd-text);
    font-size: 15px;
    outline: none;
    transition: border-color .15s ease;
}
.pd-field input:focus { border-color: var(--pd-accent); }

.pd-btn {
    display: inline-block;
    width: 100%;
    padding: 12px 16px;
    background: var(--pd-accent);
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}
.pd-btn:hover { background: var(--pd-accent-hover); }

.pd-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--pd-muted);
    margin-bottom: 18px;
}

.pd-login-error {
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .4);
    color: #fca5a5;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 18px;
}

.pd-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--pd-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.pd-divider::before,
.pd-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--pd-border);
}

/* Style the Nextend Social Login buttons so they fit the theme */
.pd-sso .nsl-container { width: 100%; }
.pd-sso .nsl-container .nsl-button { width: 100% !important; }

/* ==========================================================================
   Dashboard (page-dashboard.php)
   ========================================================================== */
.pd-shell { max-width: 1100px; margin: 0 auto; padding: 28px 20px 64px; }

.pd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.pd-header h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.pd-header .pd-user { color: var(--pd-muted); font-size: 14px; }
.pd-logout {
    font-size: 13px;
    padding: 8px 14px;
    border: 1px solid var(--pd-border);
    border-radius: 10px;
    color: var(--pd-text);
}
.pd-logout:hover { text-decoration: none; border-color: var(--pd-accent); }

/* Tabs */
.pd-tabs {
    display: inline-flex;
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 24px;
}
.pd-tab {
    border: 0;
    background: transparent;
    color: var(--pd-muted);
    padding: 9px 18px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}
.pd-tab.is-active { background: var(--pd-accent); color: #fff; }

.pd-panel { display: none; }
.pd-panel.is-active { display: block; }

/* Card grid */
.pd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.pd-card {
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    border-radius: var(--pd-radius);
    padding: 20px;
    box-shadow: var(--pd-shadow);
}
.pd-card h3 { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.pd-card .pd-meta-line { color: var(--pd-muted); font-size: 13px; margin-bottom: 14px; }
.pd-card .pd-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--pd-muted);
    margin: 14px 0 6px;
}
.pd-card p { margin: 0 0 6px; font-size: 14px; }
.pd-benefits { list-style: none; padding: 0; margin: 0; }
.pd-benefits li { font-size: 14px; padding-left: 18px; position: relative; margin-bottom: 4px; }
.pd-benefits li::before { content: "•"; position: absolute; left: 4px; color: var(--pd-accent); }

.pd-pill {
    display: inline-block;
    background: var(--pd-surface-2);
    color: var(--pd-text);
    font-size: 12px;
    padding: 3px 9px;
    border-radius: 999px;
}

/* Progress bar */
.pd-progress {
    height: 10px;
    background: var(--pd-bg);
    border: 1px solid var(--pd-border);
    border-radius: 999px;
    overflow: hidden;
    margin: 8px 0 6px;
}
.pd-progress-fill {
    height: 100%;
    background: var(--pd-accent);
    width: 0;
    transition: width .35s ease;
}
.pd-progress-fill.is-complete { background: var(--pd-success); }
.pd-progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--pd-muted);
    margin-bottom: 14px;
}

/* Category rows */
.pd-cat-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid var(--pd-border);
}
.pd-cat-row:first-of-type { border-top: 0; }
.pd-cat-name { font-size: 14px; }
.pd-cat-amount { font-size: 14px; font-weight: 600; min-width: 70px; text-align: right; }
.pd-cat-controls { display: flex; align-items: center; gap: 6px; }
.pd-cat-controls input {
    width: 80px;
    padding: 6px 8px;
    background: var(--pd-bg);
    border: 1px solid var(--pd-border);
    border-radius: 8px;
    color: var(--pd-text);
    font-size: 13px;
}
.pd-mini-btn {
    border: 0;
    background: var(--pd-accent);
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.pd-mini-btn:hover { background: var(--pd-accent-hover); }
.pd-mini-btn:disabled { opacity: .5; cursor: default; }

.pd-saved-flash { color: var(--pd-success); font-size: 12px; margin-left: 4px; }

.pd-empty {
    background: var(--pd-surface);
    border: 1px dashed var(--pd-border);
    border-radius: var(--pd-radius);
    padding: 32px;
    text-align: center;
    color: var(--pd-muted);
}

@media (max-width: 480px) {
    .pd-cat-row { grid-template-columns: 1fr; }
    .pd-cat-amount { text-align: left; }
}
