:root {
    --primary-color: #0052d4;
    --text-color: #2d3748;
    --bg-input: #f7fafc;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
    min-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Black -> Blue -> Light Blue -> White Gradient */
    background: linear-gradient(-45deg, #000000, #0052d4, #4facfe, #ffffff);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    text-align: center;
    transition: height 0.3s ease;
    margin: 0 10px;
}

@media (max-width: 767px) {
    .card {
        padding: 1.5rem; /* Reduced padding for mobile */
    }
}

.logo-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem auto;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    background: white;
    align-content: center;
    align-items: center;
    justify-content: center;
    justify-items: center;
}

.logo-container img {
    width: 70px;
    height: 70px;
    object-fit: cover;

}

/* Dynamic Company Header */
#companyHeader {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    min-height: 2rem; /* Reserve space */
}

#companyName {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    min-height: 2rem; /* Reserve space */
}

p.subtitle {
    color: #718096;
    margin-top: 5px;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

p.subtitle a {
    text-decoration: none;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid transparent;
    background-color: var(--bg-input);
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1.2rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
    outline: none;
    color: var(--text-color);

    /* CENTER CURSOR AND TEXT */
    text-align: center;
    font-weight: bold;
}

input::placeholder {
    text-align: center;
    font-weight: normal;
    opacity: 0.6;
}

input:focus {
    background-color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 82, 212, 0.1);
}

/* Result Area with Markdown Styling */
.result-box {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    background: #f8f9fa;
    border-right: 4px solid var(--primary-color);
    text-align: right; /* Ensure RTL reading */
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
    display: none;
    font-size: 1rem;
    line-height: 1.6;
}

.result-box.show {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

/* Markdown specific styles */
.result-box h1, .result-box h2, .result-box h3 {
    margin-top: 0;
    color: #333;
}

.result-box strong {
    color: #0052d4;
}

.result-box ul {
    padding-right: 20px;
}

/* RTL list fix */

.loader {
    width: 40px;
    height: 4px;
    background: #e2e8f0;
    margin: 10px auto;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    display: none;
}

.loader::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: var(--primary-color);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        width: 0;
        left: 0;
    }
    50% {
        width: 100%;
        left: 0;
    }
    100% {
        width: 0;
        left: 100%;
    }
}


/* Result Area with Markdown Styling */
.error-box {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    background: #f8f9fa;
    border-right: 4px solid red;
    text-align: right; /* Ensure RTL reading */
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
    display: none;
    font-size: 1rem;
    line-height: 1.6;
}

.error-box.show {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

/* Markdown specific styles */
.error-box h1, .error-box h2, .error-box h3 {
    margin-top: 0;
    color: #333;
}

.error-box strong {
    color: red;
}

.error-box ul {
    padding-right: 20px;
}

/* RTL list fix */
