@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=JetBrains+Mono:wght@400;700&display=swap');

#lct-dashboard {

    --bg: #f4f7fb;
    --bg2: #eef2ff;

    --card: rgba(255,255,255,0.82);

    --card-solid: #ffffff;

    --card-border: rgba(15,23,42,0.06);

    --accent: #2563eb;
    --accent2: #7c3aed;
    --accent3: #06b6d4;

    --green: #16a34a;
    --red: #dc2626;
    --yellow: #d97706;

    --text: #0f172a;
    --muted: #64748b;

    --mono: 'JetBrains Mono', monospace;

    --shadow-sm:
        0 2px 4px rgba(15,23,42,0.04);

    --shadow:
        0 12px 40px rgba(15,23,42,0.06);

    --shadow-lg:
        0 20px 60px rgba(37,99,235,0.12);

    --glass:
        linear-gradient(
            135deg,
            rgba(255,255,255,0.92),
            rgba(255,255,255,0.72)
        );

    direction: rtl;

    font-family: 'Cairo', sans-serif;

    max-width: 1500px;

    margin: 0 auto;

    padding: 34px;

    min-height: 100vh;

    color: var(--text);

    background:
        radial-gradient(circle at top right, rgba(37,99,235,0.08), transparent 24%),
        radial-gradient(circle at bottom left, rgba(124,58,237,0.08), transparent 24%),
        linear-gradient(180deg,#f8fbff 0%, #f4f7fb 100%);
}

/* ===== BODY ===== */

body {

    background: #f4f7fb;
}

/* ===== HEADER ===== */

.lct-header {

    position: relative;

    display: flex;
    justify-content: space-between;
    align-items: center;

    flex-wrap: wrap;

    gap: 20px;

    padding: 24px 30px;

    background: var(--glass);

    backdrop-filter: blur(18px);

    border: 1px solid rgba(255,255,255,0.65);

    border-radius: 28px;

    box-shadow:
        0 10px 40px rgba(15,23,42,0.05),
        inset 0 1px 0 rgba(255,255,255,0.9);

    overflow: hidden;

    margin-bottom: 30px;
}

.lct-header::before {

    content: '';

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            90deg,
            rgba(37,99,235,0.10),
            rgba(124,58,237,0.06),
            transparent
        );

    pointer-events: none;
}

.lct-header::after {

    content: '';

    position: absolute;

    top: -120px;
    left: -120px;

    width: 260px;
    height: 260px;

    background:
        radial-gradient(
            circle,
            rgba(37,99,235,0.14),
            transparent 70%
        );

    pointer-events: none;
}

.lct-header h1 {

    position: relative;
    z-index: 2;

    margin: 0;

    font-size: 1.4rem;

    font-weight: 900;

    letter-spacing: -.3px;

    color: var(--text);

    display: flex;
    align-items: center;

    gap: 14px;
}

/* ===== STATUS ===== */

.lct-status {

    position: relative;
    z-index: 2;

    display: flex;
    align-items: center;

    gap: 14px;

    flex-wrap: wrap;
}

#lctStatusText {

    font-family: var(--mono);

    font-size: .76rem;

    color: var(--muted);

    letter-spacing: 1px;
}

/* ===== STATUS DOT ===== */

.dot {

    width: 11px;
    height: 11px;

    border-radius: 50%;
}

.dot-active {

    background: var(--green);

    box-shadow:
        0 0 0 5px rgba(22,163,74,0.10),
        0 0 24px rgba(22,163,74,0.25);

    animation: pulse 2s infinite;
}

.dot-error {

    background: var(--red);

    box-shadow:
        0 0 0 5px rgba(220,38,38,0.10),
        0 0 24px rgba(220,38,38,0.25);
}

@keyframes pulse {

    0%,100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* ===== BUTTON ===== */

.sound-btn {

    position: relative;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #7c3aed
        );

    border: none;

    color: white;

    padding: 11px 18px;

    border-radius: 16px;

    font-size: .82rem;
    font-weight: 800;

    cursor: pointer;

    transition:
        transform .25s ease,
        box-shadow .25s ease;

    box-shadow:
        0 12px 30px rgba(37,99,235,0.18);
}

.sound-btn::before {

    content: '';

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,0.35),
            transparent 60%
        );

    pointer-events: none;
}

.sound-btn:hover {

    transform: translateY(-3px);

    box-shadow:
        0 18px 40px rgba(37,99,235,0.22);
}

/* ===== STATS ===== */

.lct-stats {

    display: grid;

    grid-template-columns:
        repeat(auto-fit,minmax(240px,1fr));

    gap: 20px;

    margin-bottom: 30px;
}

.stat-card {

    position: relative;

    overflow: hidden;

    background: var(--glass);

    backdrop-filter: blur(18px);

    border: 1px solid rgba(255,255,255,0.7);

    border-radius: 28px;

    padding: 30px;

    transition:
        transform .3s ease,
        box-shadow .3s ease,
        border-color .3s ease;

    box-shadow:
        0 12px 40px rgba(15,23,42,0.05),
        inset 0 1px 0 rgba(255,255,255,0.9);
}

.stat-card::before {

    content: '';

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,0.35),
            transparent 45%
        );

    pointer-events: none;
}

.stat-card::after {

    content: '';

    position: absolute;

    bottom: 0;
    left: 0;
    right: 0;

    height: 4px;

    background:
        linear-gradient(
            90deg,
            var(--accent),
            var(--accent2),
            var(--accent3)
        );
}

.stat-card:hover {

    transform: translateY(-8px);

    border-color:
        rgba(37,99,235,0.15);

    box-shadow:
        0 24px 60px rgba(37,99,235,0.12);
}

.stat-num {

    font-family: var(--mono);

    font-size: 3.2rem;

    font-weight: 800;

    letter-spacing: -2px;

    line-height: 1;

    margin-bottom: 14px;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #7c3aed
        );

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {

    font-size: .82rem;

    color: var(--muted);

    font-weight: 700;

    letter-spacing: .4px;
}

/* ===== TABLE WRAPPER ===== */

.lct-table-wrap {

    overflow-x: auto;

    border-radius: 28px;

    box-shadow:
        0 12px 40px rgba(15,23,42,0.05);
}

/* ===== TABLE ===== */

.lct-table {

    width: 100%;

    border-collapse: separate;

    border-spacing: 0;

    background: rgba(255,255,255,0.88);

    backdrop-filter: blur(18px);

    border: 1px solid rgba(255,255,255,0.8);

    overflow: hidden;

    border-radius: 28px;
}

/* ===== TABLE HEAD ===== */

.lct-table thead {

    background:
        linear-gradient(
            90deg,
            rgba(37,99,235,0.06),
            rgba(124,58,237,0.04)
        );
}

.lct-table th {

    padding: 20px 22px;

    text-align: right;

    color: #475569;

    font-size: .78rem;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 1px;

    white-space: nowrap;

    border-bottom:
        1px solid rgba(15,23,42,0.06);
}

/* ===== TABLE BODY ===== */

.lct-table td {

    padding: 18px 22px;

    color: var(--muted);

    font-size: .9rem;

    border-bottom:
        1px solid rgba(15,23,42,0.04);

    transition:
        background .2s ease,
        color .2s ease;
}

.lct-table tbody tr {

    transition: transform .2s ease;
}

.lct-table tbody tr:hover {

    transform: scale(1.002);
}

.lct-table tbody tr:hover td {

    background:
        rgba(37,99,235,0.04);

    color: var(--text);
}

.lct-table tbody tr:last-child td {

    border-bottom: none;
}

/* ===== CODE ===== */

.lct-table td strong {

    font-family: var(--mono);

    font-size: 1rem;

    font-weight: 800;

    color: #2563eb;

    letter-spacing: 2px;
}

/* ===== NEW ROW ===== */

.lct-table tbody tr:first-child {

    animation: rowIn .45s ease-out;
}

@keyframes rowIn {

    from {

        opacity: 0;

        transform:
            translateY(-10px)
            scale(.98);
    }

    to {

        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}

/* ===== BADGE ===== */

.dup-badge {

    background:
        rgba(245,158,11,0.10);

    color: #d97706;

    border:
        1px solid rgba(245,158,11,0.18);

    font-size: .66rem;

    padding: 4px 10px;

    border-radius: 30px;

    font-weight: 800;

    margin-right: 6px;
}

/* ===== EMPTY ===== */

.empty-row td {

    text-align: center;

    padding: 90px 20px;

    color: var(--muted);

    font-size: .95rem;

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.4),
            rgba(255,255,255,0.8)
        );
}

/* ===== SCROLLBAR ===== */

::-webkit-scrollbar {

    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {

    background: #edf2f7;
}
::-webkit-scrollbar-thumb {
    background:
        linear-gradient(
            #2563eb,
            #7c3aed
        );
    border-radius: 20px;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    #lct-dashboard {
        padding: 14px;
    }

    .lct-header {
        padding: 20px;
        border-radius: 22px;
    }

    .lct-header h1 {
        font-size: 1rem;
    }

    .lct-stats {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .stat-card {
        padding: 22px;
        border-radius: 22px;
    }

    .stat-num {
        font-size: 2.2rem;
    }

    .lct-table th,
    .lct-table td {
        padding: 14px 12px;
        font-size: .8rem;
    }
}

@media (max-width: 480px) {

    .lct-stats {
        grid-template-columns: 1fr;
    }

    .sound-btn {
        width: 100%;
    }

    .lct-header {
        gap: 14px;
    }
}

/* =========================
   MOBILE CARDS MODE
========================= */

@media (max-width:768px){

    .lct-table-wrap{

        overflow:visible;
    }

    .lct-table{

        background:transparent;

        border:none;

        box-shadow:none;
    }

    .lct-table thead{

        display:none;
    }

    .lct-table tbody{

        display:flex;

        flex-direction:column;

        gap:16px;
    }

    .lct-table tbody tr{

        display:flex;

        flex-direction:column;

        gap:12px;

        background:
            linear-gradient(
                135deg,
                rgba(255,255,255,.96),
                rgba(255,255,255,.82)
            );

        border:1px solid rgba(15,23,42,.06);

        border-radius:24px;

        padding:18px;

        box-shadow:
            0 10px 30px rgba(15,23,42,.06);

        position:relative;

        overflow:hidden;
    }

    .lct-table tbody tr::before{

        content:'';

        position:absolute;

        top:0;
        right:0;
        left:0;

        height:4px;

        background:
            linear-gradient(
                90deg,
                #2563eb,
                #7c3aed,
                #06b6d4
            );
    }

    .lct-table td{

        display:flex;

        align-items:center;

        justify-content:space-between;

        gap:12px;

        padding:0;

        border:none !important;

        font-size:.84rem;

        width:100%;
    }

    .lct-table td::before{

        font-weight:800;

        color:#64748b;

        font-size:.74rem;

        flex-shrink:0;
    }

    .lct-table td:nth-child(1)::before{
        content:'الوقت';
    }

    .lct-table td:nth-child(2)::before{
        content:'الكود';
    }

    .lct-table td:nth-child(3)::before{
        content:'الماركة المطلوبة';
    }

    .lct-table td:nth-child(4)::before{
        content:'المصدر';
    }

    .lct-table td:nth-child(5)::before{
        content:'الحملة';
    }

    .lct-table td:nth-child(6)::before{
        content:'الحالة';
    }

    .lct-table td strong{

        font-size:1rem;

        letter-spacing:2px;
    }

    .code-wrap{

        display:flex;

        align-items:center;

        gap:8px;

        flex-wrap:wrap;
    }

    .dup-badge{

        margin:0;

        flex-shrink:0;
    }

    .empty-row td{

        justify-content:center;

        text-align:center;

        padding:40px 0;
    }
}

