/**
 * RZDK Store - Custom CSS
 * Design System: Dark/Light mode with CSS variables
 * 
 * Colors:
 *   Background Primary: #171717 (dark) / #ffffff (light)
 *   Background Secondary: #2c2c2c (dark) / #f9fafb (light)
 *   Green Primary: #01a35a
 *   Green Accent: #0edf7d
 *   Border: #3a3a3a (dark) / #e5e7eb (light)
 * 
 * Fonts:
 *   Headings: Poppins (600, 700)
 *   Body: Inter (400, 500, 600)
 */

/* ============================================================
   BASE STYLES
   ============================================================ */

* {
    scrollbar-width: thin;
    scrollbar-color: #3a3a3a #171717;
}

.dark *::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.dark *::-webkit-scrollbar-track {
    background: #171717;
}

.dark *::-webkit-scrollbar-thumb {
    background-color: #3a3a3a;
    border-radius: 3px;
}

:not(.dark) *::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

:not(.dark) *::-webkit-scrollbar-track {
    background: #f9fafb;
}

:not(.dark) *::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 3px;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.font-heading {
    font-family: 'Poppins', sans-serif;
}

.font-body {
    font-family: 'Inter', sans-serif;
}

/* ============================================================
   COMPONENTS
   ============================================================ */

/* 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: 500;
    line-height: 1.25rem;
    transition: all 0.15s ease;
    cursor: pointer;
    outline: none;
    border: none;
}

.btn:focus-visible {
    outline: 2px solid #01a35a;
    outline-offset: 2px;
}

.btn-primary {
    background-color: #01a35a;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #0edf7d;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid #e5e7eb;
    color: inherit;
}

.dark .btn-secondary {
    border-color: #3a3a3a;
}

.btn-secondary:hover {
    border-color: #01a35a;
    color: #01a35a;
}

.btn-danger {
    background-color: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #dc2626;
}

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

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

/* Form Inputs */
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.dark .form-input {
    border-color: #3a3a3a;
    background-color: #171717;
    color: #ffffff;
}

.form-input::placeholder {
    color: #9ca3af;
}

.dark .form-input::placeholder {
    color: #6b7280;
}

.form-input:focus {
    border-color: #01a35a;
    box-shadow: 0 0 0 3px rgba(1, 163, 90, 0.1);
}

.form-input.error {
    border-color: #ef4444;
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Form Label */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: #374151;
}

.dark .form-label {
    color: #d1d5db;
}

/* Form Error Text */
.form-error {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 0.25rem;
}

/* Cards */
.card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: border-color 0.15s ease;
}

.dark .card {
    background-color: #2c2c2c;
    border-color: #3a3a3a;
}

.card:hover {
    border-color: #01a35a;
}

.card-flat {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.dark .card-flat {
    background-color: #2c2c2c;
    border-color: #3a3a3a;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.dark .table-container {
    border-color: #3a3a3a;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
}

.table-container th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    color: #6b7280;
}

.dark .table-container th {
    background-color: #2c2c2c;
    border-bottom-color: #3a3a3a;
    color: #9ca3af;
}

.table-container td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #f3f4f6;
}

.dark .table-container td {
    border-bottom-color: #2a2a2a;
}

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

.table-container tr:hover td {
    background-color: #f9fafb;
}

.dark .table-container tr:hover td {
    background-color: #252525;
}

/* Stats Card */
.stat-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.dark .stat-card {
    background-color: #2c2c2c;
    border-color: #3a3a3a;
}

.stat-card .stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.dark .stat-card .stat-label {
    color: #9ca3af;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

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

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(1, 163, 90, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(1, 163, 90, 0); }
}

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

.animate-slide-up {
    animation: slideUp 0.4s ease-out;
}

.animate-pulse-green {
    animation: pulse-green 2s infinite;
}

/* ============================================================
   UTILITIES
   ============================================================ */

/* Hide scrollbar but keep functionality */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #01a35a, #0edf7d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Green glow effect */
.glow-green {
    box-shadow: 0 0 20px rgba(1, 163, 90, 0.3);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.375rem;
}

.dark .skeleton {
    background: linear-gradient(90deg, #2c2c2c 25%, #3a3a3a 50%, #2c2c2c 75%);
    background-size: 200% 100%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Tooltip base (use with Alpine.js) */
.tooltip {
    position: relative;
}

/* Status dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online { background-color: #10b981; }
.status-dot.offline { background-color: #6b7280; }
.status-dot.warning { background-color: #f59e0b; }
.status-dot.error { background-color: #ef4444; }
