:root {
    --primary-color: #25d366;
    /* WhatsApp Green */
    --primary-hover: #128c7e;
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --danger: #ff5f5f;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
}

body {
    background: linear-gradient(45deg, #111b21, #202c33, #0b141a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem;
    direction: rtl;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.container {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.status-card {
    text-align: center;
}

.status-indicator {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: bold;
    margin-bottom: 1rem;
    background: rgba(255, 0, 0, 0.4);
    transition: background 0.5s;
}

.status-indicator.ready {
    background: rgba(37, 211, 102, 0.6);
}

#qr-container img {
    border-radius: 10px;
    max-width: 100%;
    margin-top: 1rem;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

h1,
h2,
h3 {
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Forms & Inputs */
input,
textarea,
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: background 0.3s;
    text-align: right;
    /* RTL Input */
}

input:focus,
textarea:focus {
    background: rgba(255, 255, 255, 0.15);
}

button {
    padding: 12px 24px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

button:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

button.danger-btn {
    background: var(--danger);
}

/* Tables */
.table-container {
    max-height: 400px;
    overflow-y: auto;
}

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

th,
td {
    text-align: right;
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

th {
    background: rgba(255, 255, 255, 0.05);
}

tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Logs */
#log-container {
    height: 150px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.9rem;
    color: #aeaeae;
    direction: ltr;
    /* Logs usually look better LTR */
    text-align: left;
}

.log-entry {
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }
}