/* ============================================================
   USER THEME SYSTEM
   Supports: light, dark, cute
   ============================================================ */

/* DEFAULT THEME (DARK MODE by default now) */
:root {
    /* MATCHING THEME-DARK.CSS EXACTLY */
    --bg: #020617;
    --bg2: #020617;
    --bg3: #0f172a;
    --card: #020617;
    
    --text: #e5e7eb;
    --text-muted: #94a3b8;
    
    --border: #1e293b;

    /* Sexy Blue Accent */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --accent-gradient-hover: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);

    --button-bg: var(--accent-gradient);
    --button-bg-hover: var(--accent-gradient-hover);

    --danger-bg: #b91c1c;
    --danger-bg-hover: #dc2626;
}

/* DARK THEME */
:root[data-theme="dark"] {
    --bg: #020617;
    --bg2: #020617;
    --bg3: #0f172a;
    --text: #e5e7eb;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --accent-gradient-hover: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    --button-bg: var(--accent-gradient);
    --button-bg-hover: var(--accent-gradient-hover);
    --danger-bg: #b91c1c;
    --danger-bg-hover: #dc2626;
}

/* LIGHT THEME */
:root[data-theme="light"] {
    --bg: #ffffff;
    --bg2: #f5f5f5;
    --bg3: #ededed;
    --text: #111827;
    --text-muted: #4b5563;
    --border: #d1d5db;
    --accent: #dc2626;
    --accent-hover: #b91c1c;
    --accent-gradient: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --accent-gradient-hover: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --button-bg: var(--accent-gradient);
    --button-bg-hover: var(--accent-gradient-hover);
    --danger-bg: #dc2626;
    --danger-bg-hover: #b91c1c;
}

/* CUTE DOGGY THEME */
:root[data-theme="cute"] {
    --bg: #fffaf0;
    --bg2: #fff1e6;
    --bg3: #ffe4d6;
    --text: #5b3427;
    --text-muted: #8b5e3c;
    --border: #f3b48c;
    --accent: #ff7f50;
    --accent-hover: #ff6a33;
    --accent-gradient: linear-gradient(135deg, #ff7f50 0%, #ff6a33 100%);
    --accent-gradient-hover: linear-gradient(135deg, #ff9f7d 0%, #ff7f50 100%);
    --button-bg: var(--accent-gradient);
    --button-bg-hover: var(--accent-gradient-hover);
    --danger-bg: #e11d48;
    --danger-bg-hover: #be123c;
}

/* ============================================
   BODY
============================================ */
body.user-body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ============================================
   HEADER
============================================ */
.user-header {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    position: relative;
    z-index: 50;
}

.user-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Logo in center */
.user-logo {
    position: relative;
    left: auto;
    transform: none;
}

.user-logo img {
    height: 36px;
    width: auto;
    display: block;
}

/* ============================================
   HAMBURGER (Always visible)
============================================ */
.user-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 101; /* Above nav */
}

.user-hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s ease;
}

/* X animation */
.user-hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.user-hamburger.active span:nth-child(2) {
    opacity: 0;
}
.user-hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ============================================
   NAV MENU (Dropdown style on all screens)
============================================ */
.user-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    border-radius: 0 0 16px 16px;
    box-sizing: border-box;
}

.user-nav.open {
    display: flex;
    animation: slideDown 0.2s ease-out forwards;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-nav a {
    padding: 0.75rem 0;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    transition: color 0.2s;
    display: block;
}

.user-nav a:last-child {
    border-bottom: none;
}

.user-nav a:hover {
    color: var(--accent);
    background: transparent;
    padding-left: 0; /* No indent on hover for full width style */
}

/* ============================================
   THEME TOGGLE PILL
============================================ */
.theme-toggle {
    margin-left: auto;
}

.theme-pill {
    display: inline-flex;
    align-items: center;
    background: var(--bg3);
    border-radius: 999px;
    border: 1px solid var(--border);
    padding: 2px;
    gap: 2px;
}

.theme-option {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.85rem;
    line-height: 1;
}

.theme-option.active {
    background: var(--accent);
    color: var(--bg);
}

/* ============================================
   MAIN CONTENT
============================================ */
.user-main {
    max-width: 1100px;
    margin: 1.5rem auto 2rem auto;
    padding: 0 1.5rem;
}

/* ============================================
   FOOTER
============================================ */
.user-footer {
    border-top: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================
   GENERIC TEXT STYLES
============================================ */
.user-title {
    font-size: 1.7rem;
    margin: 0 0 0.35rem;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   BUTTONS
============================================ */
.btn,
.user-btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    background: var(--button-bg) !important; /* Force gradient */
    color: white;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); /* Blue shadow */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover,
.user-btn:hover {
    background: var(--button-bg-hover) !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.btn-danger {
    background: var(--danger-bg);
}

.btn-danger:hover {
    background: var(--danger-bg-hover);
}

.user-btn.small {
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
}

/* ============================================
   LOGIN PAGE
============================================ */
.user-login-body {
    margin: 0;
    padding: 0;
    background: var(--bg3);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    color: var(--text);
}

.user-login-box {
    background: var(--bg);
    padding: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.user-login-title {
    margin: 0 0 1rem;
    text-align: center;
    font-size: 1.4rem;
    color: var(--text); /* White title for dark theme */
}

.user-login-error {
    background: var(--danger-bg);
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    color: #fff;
}

.user-login-field {
    margin-bottom: 1rem;
}

.user-login-field label {
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.3rem;
    color: var(--text-muted);
}

.user-login-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text);
    box-sizing: border-box;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.user-login-input:focus {
    outline: none;
    border-color: var(--accent);
    background: #1e293b;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.user-login-button {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 50px;
    border: none;
    background: var(--button-bg);
    color: white;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.3rem;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.user-login-button:hover {
    background: var(--button-bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.user-login-hint {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   DASHBOARD LAYOUT
============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.dash-card {
    background: var(--bg2);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 1.2rem 1.3rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.dash-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.dash-note {
    margin: 0.4rem 0 0.8rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.wallet-amount {
    font-size: 1.7rem;
    margin: 0.4rem 0 0.5rem;
}

/* Dog list */
.dog-list {
    list-style: none;
    padding-left: 0;
    margin: 0.3rem 0 0.8rem;
}

.dog-list li {
    margin-bottom: 0.25rem;
}

.dog-breed {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Full-width card on grid */
.full-width {
    grid-column: 1 / -1;
}

/* ============================================
   CARD + TABLE STYLES (admin-* reused for user)
============================================ */
.admin-card {
    background: var(--bg2);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 1.2rem 1.3rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.admin-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.admin-table th {
    font-weight: 600;
    color: var(--text-muted);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

/* Forms */
.admin-form {
    margin-top: 1rem;
}

.admin-form-group {
    margin-bottom: 0.9rem;
}

.admin-form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.admin-input,
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="number"],
.admin-form input[type="tel"],
.admin-form textarea,
.admin-form input[type="password"],
.admin-form input[type="date"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text);
    box-sizing: border-box;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.admin-input:focus,
.admin-form input:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #1e293b; /* Slightly lighter on focus */
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.admin-form textarea {
    resize: vertical;
}

/* Flash message */
.admin-flash {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #bbf7d0;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    margin: 0.5rem 0 0.9rem;
    font-size: 0.9rem;
}

/* ============================================
   CALENDAR PAGE
============================================ */
.user-calendar-date-form {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.user-calendar-date-form input[type="date"] {
    margin-left: 0.35rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text);
}

.user-calendar-nav {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.user-calendar-nav a {
    color: var(--text);
    text-decoration: none;
}

.user-calendar-nav a:hover {
    color: var(--accent);
}

.user-calendar-nav .disabled {
    color: var(--text-muted);
    opacity: 0.5;
    cursor: not-allowed;
}