/* ============================================================
   BunnyTask – main.css
   Dark-theme stylesheet for admin + bunny PWA
   ============================================================ */

/* ------------------------------------------------------------
   CSS Custom Properties
   ------------------------------------------------------------ */
:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --card: #334155;
    --border: #475569;
    --primary: #aa70ff;
    --primary-hover: #6540a9;
    --primary-light: rgba(127, 70, 229, 0.15);
    --primary-dark: #5e2abc;
    --primary-dark-hover: #4d209e;
    --success: #22c55e;
    --success-hover: #1b793d;
    --success-light: rgba(34, 197, 94, 0.15);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    --text: #f1f5f9;
    --muted: #94a3b8;
    --radius: 0;
    --task-btn-radius: 0.3rem;
    --radius-sm: 0;
    --shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --transition: 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

/* ------------------------------------------------------------
   Icon Styles
   ------------------------------------------------------------ */
.icon-img {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
}

.icon-img-lg {
    width: 1.5em;
    height: 1.5em;
}

.empty-state-icon img,
.login-logo-icon img,
.app-logo-icon img {
    display: inline-block;
    max-width: 100%;
    height: auto;
}

/* ------------------------------------------------------------
   Reset & Base
   ------------------------------------------------------------ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        sans-serif;
    min-height: 100vh;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

ul,
ol {
    list-style: none;
}

img,
svg {
    display: block;
    max-width: 100%;
}

button {
    font-family: inherit;
}

/* ------------------------------------------------------------
   Scrollbar (webkit)
   ------------------------------------------------------------ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* ------------------------------------------------------------
   Login Page
   ------------------------------------------------------------ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--bg);
    background-image: radial-gradient(
        ellipse 80% 60% at 50% -10%,
        rgba(79, 70, 229, 0.25) 0%,
        transparent 70%
    );
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    border-top: 3px solid var(--primary);
    animation: fadeInUp 0.35s ease both;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo .logo-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    display: block;
}

.login-logo .logo-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.login-logo .logo-subtitle {
    font-size: 0.875rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-form input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    color: var(--text);
    font-size: 0.9375rem;
    transition:
        border-color var(--transition),
        box-shadow var(--transition);
    outline: none;
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.login-form input::placeholder {
    color: var(--border);
}

.login-submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition:
        background var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
    letter-spacing: 0.01em;
}

.login-submit:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.login-submit:active {
    transform: translateY(1px);
}

.login-error {
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--danger-light);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ------------------------------------------------------------
   App Layout – Main
   ------------------------------------------------------------ */
.app-main {
    padding: 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ------------------------------------------------------------
   Cards
   ------------------------------------------------------------ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* ------------------------------------------------------------
   Stats Bar
   ------------------------------------------------------------ */
.stats-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.stat-card {
    flex: 1;
    min-width: 120px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.stat-total::before {
    background: var(--primary);
}
.stat-card.stat-pending::before {
    background: var(--warning);
}
.stat-card.stat-progress::before {
    background: var(--primary);
}
.stat-card.stat-done::before {
    background: var(--success);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

/* ------------------------------------------------------------
   Loading Spinner
   ------------------------------------------------------------ */
.spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2.5px solid rgba(79, 70, 229, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-lg {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 3px;
}

.spinner-center {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

/* ------------------------------------------------------------
   Section divider / util
   ------------------------------------------------------------ */
.divider {
    height: 1px;
    background: var(--border);
    margin: 1.25rem 0;
}

.text-muted {
    color: var(--muted);
}
.text-primary {
    color: var(--primary);
}
.text-success {
    color: var(--success);
}
.text-danger {
    color: var(--danger);
}
.text-warning {
    color: var(--warning);
}
.text-sm {
    font-size: 0.875rem;
}
.text-xs {
    font-size: 0.75rem;
}

.flex {
    display: flex;
}
.flex-col {
    flex-direction: column;
}
.items-center {
    align-items: center;
}
.justify-between {
    justify-content: space-between;
}
.gap-1 {
    gap: 0.25rem;
}
.gap-2 {
    gap: 0.5rem;
}
.gap-3 {
    gap: 0.75rem;
}
.gap-4 {
    gap: 1rem;
}
.flex-wrap {
    flex-wrap: wrap;
}
.flex-1 {
    flex: 1;
}
.w-full {
    width: 100%;
}
.mt-1 {
    margin-top: 0.25rem;
}
.mt-2 {
    margin-top: 0.5rem;
}
.mt-4 {
    margin-top: 1rem;
}
.mb-2 {
    margin-bottom: 0.5rem;
}
.mb-4 {
    margin-bottom: 1rem;
}

/* ------------------------------------------------------------
   Keyframe Animations
   ------------------------------------------------------------ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
        max-height: 200px;
        margin-bottom: 0;
    }
    to {
        opacity: 0;
        transform: translateX(30px);
        max-height: 0;
        margin-bottom: -0.625rem;
        padding-top: 0;
        padding-bottom: 0;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
