/* ThriftDuck Custom Styles */

/* ─── CSS Variables ─── */
:root {
    --td-green: #274c2f;
    --td-grey: #a3a09b;
    --td-orange: #e35d14;
    --td-dark: #333330;
    --td-success: #16a34a;
    --td-error: #dc2626;
    --td-warning: #f59e0b;
    --td-info: #0ea5e9;
}

/* ─── Base ─── */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--td-grey);
    border-radius: 3px;
}

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

/* ─── Form Inputs ─── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="tel"],
input[type="url"],
select {
    width: 100%;
    padding: 0.625rem 0.875rem !important;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--td-dark);
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
    width: 100% !important;
    padding: 0.625rem 0.875rem !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.5rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    color: var(--td-dark) !important;
    background: white !important;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
}

/* Inputs with leading icons/symbols - override default padding */
input.pl-10, input.\!pl-10 {
    padding-left: 2.5rem !important;
}
input.pl-8, input.\!pl-8 {
    padding-left: 2rem !important;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--td-green);
    box-shadow: 0 0 0 3px rgba(39, 76, 47, 0.1);
}

input.error,
textarea.error,
select.error {
    border-color: var(--td-error);
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--td-green);
    color: white;
}

.btn-primary:hover {
    background: #3a6b44;
}

.btn-accent {
    background: var(--td-orange);
    color: white;
}

.btn-accent:hover {
    background: #f07030;
}

.btn-outline {
    background: transparent;
    border: 1px solid #e5e7eb;
    color: var(--td-dark);
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-danger {
    background: var(--td-error);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* ─── Cards ─── */
.card {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card-body {
    padding: 1.25rem;
}

/* ─── Stat Cards ─── */
.stat-card {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    padding: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--td-dark);
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--td-grey);
    margin-top: 0.25rem;
}

/* ─── Badge ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-green { background: #dcfce7; color: #166534; }
.badge-orange { background: #fff7ed; color: #9a3412; }
.badge-red { background: #fef2f2; color: #991b1b; }
.badge-grey { background: #f3f4f6; color: #374151; }
.badge-blue { background: #eff6ff; color: #1e40af; }

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state svg {
    width: 4rem;
    height: 4rem;
    color: var(--td-grey);
    margin: 0 auto 1rem;
    opacity: 0.4;
}

/* ─── Print Styles ─── */
@media print {
    body * {
        visibility: hidden;
    }
    .print-area, .print-area * {
        visibility: visible;
    }
    .print-area {
        position: absolute;
        left: 0;
        top: 0;
    }
    .no-print {
        display: none !important;
    }
}

/* ─── Loading Spinner ─── */
.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #e5e7eb;
    border-top-color: var(--td-green);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ─── Mobile Optimizations ─── */
@media (max-width: 640px) {
    .btn {
        width: 100%;
    }

    .btn-inline {
        width: auto !important;
    }
}
