/* =========================
   GLOBAL + TECH BACKGROUND
========================= */
body {
    margin: 0;
    font-family: 'Cairo', sans-serif;
    direction: rtl;

    min-height: 100vh;
    color: white;

    display: flex;
    flex-direction: column;

    /* TECH BACKGROUND */
    background:
        radial-gradient(circle at 20% 30%, rgba(124,58,237,0.25), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(6,182,212,0.25), transparent 40%),
        linear-gradient(135deg, #050816, #0b1220 60%, #020617);
}

/* =========================
   WRAPPER (CENTER FULL)
========================= */
.wrapper {
    flex: 1;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 20px;
}

/* =========================
   CARD (CENTERED SaaS)
========================= */
.card {
    width: 100%;
    max-width: 700px;

    text-align: center;

    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(10px);

    padding: 30px;
    border-radius: 20px;

    box-shadow: 0 20px 60px rgba(0,0,0,0.5);

    box-sizing: border-box;
    overflow: hidden;
}

/* =========================
   HEADER CENTER
========================= */
.header-center {
    text-align: center;
    margin-bottom: 25px;
}

/* LOGO IMAGE */
.logo-img {
    width: 70px;
    height: auto;

    margin-bottom: 10px;
    object-fit: contain;
}

/* TITLE */
.header-center h1 {
    margin: 5px 0;
    font-size: 24px;
}

/* DESCRIPTION */
.desc {
    opacity: 0.7;
    font-size: 14px;
    margin-top: 5px;
}

/* =========================
   SEARCH
========================= */
.search {
    display: flex;
    flex-direction: column;
    gap: 12px;

    margin: 20px auto 0;
    width: 100%;
    max-width: 400px;
}

/* =========================
   INPUT (RGB BORDER ONLY)
========================= */
input {
    width: 100%;
    padding: 14px 16px;

    font-size: 15px;
    border-radius: 14px;

    color: white;
    background: rgba(0,0,0,0.25);

    border: 2px solid transparent;
    outline: none;

    box-sizing: border-box;

    /* RGB BORDER */
    background-image:
        linear-gradient(#0b1220, #0b1220),
        linear-gradient(90deg, #ff004c, #7c3aed, #00d4ff, #facc15, #ff004c);

    background-origin: border-box;
    background-clip: padding-box, border-box;

    background-size: 300% 300%;
    animation: rgbBorder 5s linear infinite;

    transition: 0.3s;
}

input:focus {
    box-shadow:
        0 0 0 2px rgba(99,102,241,0.3),
        0 0 15px rgba(0,212,255,0.2);

    transform: scale(1.01);
}

/* =========================
   BUTTON
========================= */
button {
    width: 100%;
    padding: 14px;

    border-radius: 14px;
    border: none;

    font-weight: 600;
    font-size: 15px;

    cursor: pointer;
    color: white;

    background: linear-gradient(90deg, #7c3aed, #06b6d4, #f59e0b);
    background-size: 200% 200%;

    transition: 0.3s;
}

button:hover {
    transform: translateY(-1px);
    background-position: right center;
}

/* =========================
   RESULT
========================= */
#result {
    margin-top: 20px;
    width: 100%;

    opacity: 0;
    transform: translateY(20px);
    transition: 0.4s ease;

    display: flex;
    justify-content: center;

    overflow-x: auto;
}

#result.show {
    opacity: 1;
    transform: translateY(0);
}

/* =========================
   MINI CARD (FETCH RESULT)
========================= */
.mini-card {
    width: 100%;
    max-width: 500px;

    padding: 18px;
    margin-top: 10px;

    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);

    border-radius: 16px;
}

.mini-card h2 {
    font-size: 17px;
    margin-bottom: 10px;
}

/* =========================
   TABLE
========================= */
.table {
    width: 100%;
    margin-top: 20px;

    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;

    table-layout: fixed;
}

.table th,
.table td {
    padding: 10px;
    font-size: 14px;
    word-break: break-word;
}

.table th {
    background: rgba(255,255,255,0.1);
}

.table td {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.table tr:hover {
    background: rgba(255,255,255,0.05);
}

/* =========================
   STATUS
========================= */
.ok { color: #22c55e; font-weight: bold; }
.bad { color: #ef4444; font-weight: bold; }

/* =========================
   LOADING POPUP
========================= */
#loading {
    position: fixed;
    inset: 0;

    background: rgba(5,10,20,0.85);
    backdrop-filter: blur(6px);

    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 9999;

    opacity: 0;
    pointer-events: none;

    transition: 0.3s;
}

#loading.show {
    opacity: 1;
    pointer-events: all;
}

.loader-box {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;

    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.1);
    border-top: 3px solid #7c3aed;

    animation: spin 1s linear infinite;

    margin: auto;
}

.loader-box p {
    margin-top: 12px;
    font-size: 14px;
    opacity: 0.8;
}

/* =========================
   FOOTER (ALWAYS DOWN)
========================= */
.footer {
    text-align: center;
    padding: 15px;

    font-size: 13px;
    opacity: 0.5;

    margin-top: auto;
}

/* =========================
   ANIMATIONS
========================= */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes rgbBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* =========================
   TABLET
========================= */
@media (max-width: 768px) {

    .card {
        padding: 22px;
    }

    .header-center h1 {
        font-size: 22px;
    }

    .table th,
    .table td {
        font-size: 13px;
        padding: 8px;
    }
}

/* =========================
   MOBILE
========================= */
/* =========================
   MOBILE IMPROVED
========================= */
@media (max-width: 480px) {

    body {
        font-size: 15px; /* كان صغير */
    }

    .wrapper {
        padding: 15px;
    }

    .card {
        padding: 20px;
        border-radius: 18px;
    }

    /* LOGO */
    .logo-img {
        width: 65px; /* كان 55 */
    }

    /* TITLE */
    .header-center h1 {
        font-size: 22px;
    }

    /* DESCRIPTION */
    .desc {
        font-size: 14px;
    }

    /* INPUT */
    input {
        padding: 14px;
        font-size: 15px;
    }

    /* BUTTON */
    button {
        padding: 14px;
        font-size: 15px;
    }

    /* TABLE */
    .table th,
    .table td {
        font-size: 13px;
        padding: 10px;
    }

    /* MINI CARD */
    .mini-card {
        padding: 20px;
    }
}