/* ===================================================================
   MAsmmpanel Master UI Stylesheet
   Focus: Clean, Simple, Crisp Visible Borders, Easy Scrolling & Usability
   =================================================================== */

/* --- 1. Typography & Global Resets --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #0f172a;
    background-color: #f8fafc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- 2. Custom Scrollbar (Clear, Easy to Grab & Scroll) --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
    border: 2px solid #f1f5f9;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

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

/* Smooth Touch & Momentum Scrolling */
.scroll-container,
.overflow-y-auto,
.overflow-x-auto,
main,
aside {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

/* --- 3. Crisp, Visible Borders & Surfaces --- */
.ui-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ui-card-hover:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
}

.ui-card-strong {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

/* Glass Card with Solid Visible Border */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid #cbd5e1 !important;
    border-radius: 1.25rem;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

.glass-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.04);
}

/* --- 4. Inputs, Selects & Forms with Solid Borders --- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
select,
textarea {
    border: 1px solid #cbd5e1 !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15) !important;
    outline: none !important;
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
}

/* --- 5. Clean, Readable Tables with Sticky Headers --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #cbd5e1;
    border-radius: 1rem;
    background: #ffffff;
}

.ui-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.ui-table thead {
    background-color: #f1f5f9;
    color: #1e293b;
    border-bottom: 2px solid #cbd5e1;
    position: sticky;
    top: 0;
    z-index: 10;
}

.ui-table th {
    padding: 0.875rem 1.25rem;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
}

.ui-table td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.ui-table tbody tr {
    transition: background-color 0.15s ease;
}

.ui-table tbody tr:hover {
    background-color: #f8fafc;
}

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

/* --- 6. Badges & Indicators --- */
.ui-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    border: 1px solid transparent;
}

.ui-badge-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.ui-badge-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.ui-badge-info    { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.ui-badge-danger  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.ui-badge-neutral { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

/* --- 7. Buttons --- */
.btn-primary {
    background-color: #22c55e;
    color: #ffffff;
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid #16a34a;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background-color: #16a34a;
    border-color: #15803d;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: #ffffff;
    color: #334155;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.25s ease-out forwards;
}
