/* Lingo-inspired System Styles */

:root {
    --lingo-primary: #58cc02;
    --lingo-primary-dark: #46a302;
    --lingo-secondary: #ce82ff;
    --lingo-success: #58cc02;
    --lingo-warning: #ffc800;
    --lingo-danger: #ff4b4b;
    --lingo-surface: #ffffff;
    --lingo-bg: #f5f8ff;
    --lingo-text: #3c3c3c;
    --lingo-muted: #6a6f7d;
    --lingo-border: #d7deeb;
    --lingo-focus: #7fd93a;
}

body {
    font-family: 'Nunito', 'Tajawal', sans-serif;
    direction: rtl;
    color: var(--lingo-text);
    background: radial-gradient(circle at top right, #f0faff 0%, #f5f8ff 45%, #eef4ff 100%);
}

[x-cloak] { display: none !important; }

/* Surfaces */
.lingo-card,
.card,
.panel {
    background: var(--lingo-surface);
    border: 2px solid var(--lingo-border);
    border-bottom-width: 5px;
    border-radius: 18px;
    box-shadow: 0 6px 16px rgba(31, 41, 55, 0.06);
}

/* Buttons */
.btn,
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border-radius: 14px;
    border: 2px solid transparent;
    border-bottom-width: 4px;
    font-weight: 800;
    font-size: 0.92rem;
    line-height: 1.1;
    transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover { filter: brightness(1.03); }
.btn:active { transform: translateY(1px); border-bottom-width: 3px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
    background: var(--lingo-primary);
    border-color: #3f9700;
    color: #fff;
}
.btn-secondary {
    background: #f0e2ff;
    border-color: #b66df1;
    color: #5a2c87;
}
.btn-success {
    background: #8ae44a;
    border-color: #4aa914;
    color: #1d3c00;
}
.btn-danger {
    background: #ff6f6f;
    border-color: #d73c3c;
    color: #fff;
}
.btn-warning {
    background: #ffd84a;
    border-color: #d8aa00;
    color: #5f4500;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
    border: 2px solid var(--lingo-border);
    border-bottom-width: 4px;
    border-radius: 14px;
    background: #fff;
    color: var(--lingo-text);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--lingo-focus) !important;
    box-shadow: 0 0 0 3px rgba(88, 204, 2, 0.16);
}

label {
    font-weight: 800;
    color: #4b5563;
}

/* Navigation — app header */
.app-navbar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 252, 255, 0.94) 100%);
    border-bottom: 1px solid rgba(215, 222, 235, 0.95);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 4px 24px -4px rgba(31, 41, 55, 0.07);
}

.app-navbar__brand {
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.app-navbar__brand:hover {
    opacity: 0.92;
    transform: translateY(-0.5px);
}

/*
 * Desktop nav “track”: الشكل فقط — التخطيط والـ gap من Tailwind في app.php
 * (تفادي تعارض أو ضعف تطبيق gap مع inline-flex)
 */
.nav-pill-group {
    border-radius: 999px;
    background: rgba(241, 245, 249, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.9);
    max-width: 100%;
}

.nav-pill-group .nav-link {
    flex: 0 0 auto;
    flex-shrink: 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0.5rem 1.125rem;
    min-height: 2.5rem;
    min-width: max-content;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #475569;
    border: 1px solid transparent;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #1e3a0c;
    border-color: rgba(183, 229, 154, 0.45);
    box-shadow: 0 1px 2px rgba(31, 41, 55, 0.05);
}

.nav-link.active {
    background: #fff;
    color: #245408;
    border-color: rgba(88, 204, 2, 0.35);
    box-shadow:
        0 1px 3px rgba(31, 41, 55, 0.08),
        0 0 0 1px rgba(183, 229, 154, 0.5);
}

/* Admin entry — distinct but cohesive */
.nav-link--admin {
    color: #991b1b;
    font-weight: 800;
}
.nav-link--admin:hover {
    background: rgba(254, 226, 226, 0.55);
    color: #7f1d1d;
    border-color: rgba(252, 165, 165, 0.6);
}
.nav-link--admin.active {
    background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
    color: #7f1d1d;
    border-color: rgba(248, 113, 113, 0.45);
    box-shadow: 0 1px 3px rgba(185, 28, 28, 0.12);
}

/* Mobile sheet links — المسافة بين البنود من الـ container (gap) */
.nav-link--stack {
    display: flex;
    width: 100%;
    border-radius: 14px;
    padding: 0.75rem 1.1rem;
    justify-content: flex-start;
}

.admin-link {
    display: block;
    padding: 0.56rem 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 800;
    color: #1f2937;
    border: 2px solid transparent;
}
.admin-link:hover {
    background: #ecf9df;
    color: #2d6a00;
    border-color: #b7e59a;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid transparent;
}
.badge-success { background: #e8f9da; color: #2f6d00; border-color: #b7e59a; }
.badge-danger { background: #ffe6e6; color: #a01818; border-color: #ffb8b8; }
.badge-warning { background: #fff4cc; color: #8a6400; border-color: #ffe08a; }
.badge-info { background: #efe4ff; color: #6c33a2; border-color: #d8b4ff; }

/* Tables */
table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}
thead th {
    background: #f4f8ff;
    color: #556070;
    font-weight: 800;
}
th, td {
    border-bottom: 1px solid #e9eef8;
}

/* Helpers */
.spinner {
    border: 4px solid rgba(88, 204, 2, 0.2);
    border-top: 4px solid var(--lingo-primary);
    border-radius: 999px;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar {
    background: linear-gradient(90deg, #7bd836, #58cc02);
    transition: width 0.3s ease;
}

/* Tailwind-size compatibility layer (after removing CDN runtime) */
.w-1 { width: 0.25rem; }
.h-1 { height: 0.25rem; }
.w-1\.5 { width: 0.375rem; }
.h-1\.5 { height: 0.375rem; }
.w-2 { width: 0.5rem; }
.h-2 { height: 0.5rem; }
.w-2\.5 { width: 0.625rem; }
.h-2\.5 { height: 0.625rem; }
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-9 { width: 2.25rem; }
.h-9 { height: 2.25rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.w-14 { width: 3.5rem; }
.h-14 { height: 3.5rem; }

/* Keep icons from inheriting giant fallback sizes */
svg.w-1, svg.w-1\.5, svg.w-2, svg.w-2\.5, svg.w-3, svg.w-4, svg.w-5, svg.w-6,
svg.w-8, svg.w-9, svg.w-10, svg.w-12, svg.w-14 {
    flex-shrink: 0;
}
