/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

/* ========== صفحة تسجيل الدخول ========== */
.login-page {
    font-family: 'Cairo', sans-serif;
    background: #412905;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-image: linear-gradient(rgb(0 0 0 / 0%), rgb(85 71 66)),url(../images/img2.webp);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}

.login-card {
    background: #cba266d9;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgb(0 0 0 / 59%);
    width: 300px;
    text-align: center;
}

.login-card h2 {
    margin-top: 0;
    color: #100b02;
}

.login-card input {
    font-family: 'Cairo', sans-serif;
    width: 90%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.avatar {
    position: absolute;
    width: 150px;
    margin-left: auto;
    margin-right: auto;
    top: 74px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgb(0 0 0 / 59%);
}

.fixed-header{
    position: fixed;
    border-radius: 20px;
    top: -20px;
    left: 0;
    width: 100%;
    background-color: #63471d;
    color: white;
    padding: 20px 0;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 2px 10px rgb(0 0 0 / 55%);
}

.logodar{
    position: fixed;
    top: 95px;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0px 0px 5px 1px rgb(0 0 0 / 60%);
    z-index: 1000;
    background-image: url(../images/54545.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    width: 40px;
    height: 40px;
}

.login-card button {
    font-family: 'Cairo', sans-serif;
    width: 96%;
    padding: 10px;
    background: #2f1c00;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-card button:hover {
    background: #7b4f0e;
}

.login-card p {
    font-size: 0.8rem;
    color: #140500;
    text-align: right;
    margin-top: 15px;
}

.login-error {
    color: red;
    font-weight: bold;
}

/* ========== الصفحة الرئيسية ========== */
body {
    font-family: 'Cairo', sans-serif;
    margin: 30px;
    color: #333;
    background: #c55b37c2;
    background-image: linear-gradient(rgb(235 200 187 / 57%), rgb(85 71 66)), url(../images/img2.webp);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}

button, input, select, textarea {
    font-family: 'Cairo', sans-serif;
}

/* Box Container */
.box {
    background: #e5caa0ad;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgb(0 0 0 / 55%);
    margin-bottom: 25px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.box h3 {
    color: #333;
    margin-top: 0;
}

.box p {
    color: #2f1c00;
    line-height: 1.6;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.header strong {
    color: #412905;
}

.header a {
    color: #dc3545;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.header a:hover {
    color: #a02834;
}

/* Buttons */
button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    box-shadow: 0 2px 10px rgb(0 0 0 / 55%);
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#startBtn {
    background: #450c0c;
    color: white;
    margin-right: 5px;
}

#startBtn:hover:not(:disabled) {
    background: #7b4f0e;
}

#pauseBtn {
    background: #37240a;
    color: white;
}

#pauseBtn:hover:not(:disabled) {
    background: #5a3a10;
}

/* File Input */
#fileInput {
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #3E2723;
    border-radius: 4px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    background: #e0e0e061;
    border-radius: 10px;
    margin: 15px 0;
    overflow: hidden;
    box-shadow: 0 2px 10px rgb(0 0 0 / 55%);
    height: 30px;
}

.progress-fill {
    width: 0%;
    height: 32px;
    background: #7b4f0e;
    text-align: center;
    line-height: 32px;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    transition: width 0.3s ease;
    box-shadow: inset 0px 1px 8px 8px rgb(27 2 2 / 38%);
}

/* Info Text */
.info-row {
    display: flex;
    font-size: 0.85rem;
    color: #211406;
    margin-top: 5px;
    justify-content: space-evenly;
}

#speedTxt, #timeTxt {
    padding: 5px 0;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    text-align: right;
}

th, td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: right;
    font-size: 12px;
    word-break: break-all;
}

th {
    background: #574139;
    font-weight: 600;
    color: #1e120e;
}

tr:hover {
    background: #dbf10626;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 4px;
    border-radius: 3px;
    font-size: 10px;
    color: white;
    font-weight: 600;
}

.bg-success {
    background: #0099067a;
}

.bg-warning {
    background: #ffc107;
    color: #333;
}

/* Buttons in Table */
.btn-del {
    color: #450c0c;
    /* font-weight: bold; */
    text-decoration: none;
    transition: color 0.3s;
}

.btn-del:hover {
    color: #ff0000;
    text-decoration: underline;
}

/* Monospace Text */
.monospace {
    font-family: monospace;
    font-size: 0.8rem;
    color: #5a4020;
}

/* ========== التصميم المتجاوب (Responsive) ========== */
@media (max-width: 768px) {
    body {
        margin: 15px;
    }

    .box {
        padding: 15px;
        margin-bottom: 15px;
    }

    .box h3 {
        font-size: 1.1rem;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header a {
        align-self: flex-end;
    }

    button {
        padding: 10px 12px;
        font-size: 0.95rem;
        width: 100%;
        margin-bottom: 8px;
    }

    #startBtn, #pauseBtn {
        width: 48%;
        margin-bottom: 10px;
    }

    #pauseBtn {
        margin-right: 0;
    }

    #fileInput {
        width: 90%;
        padding: 10px;
        margin-bottom: 10px;
    }

    .progress-bar {
        margin: 10px 0;
    }

    .progress-fill {
        height: 24px;
        line-height: 24px;
        font-size: 0.9rem;
    }

    .info-row {
        flex-direction: column;
        gap: 5px;
    }

    #speedTxt, #timeTxt {
        padding: 3px 0;
    }

    /* Table Responsive */
    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 8px 5px;
    }

    th {
        font-size: 0.9rem;
    }

    .monospace {
        font-size: 0.7rem;
        word-break: break-all;
    }

    .btn-del {
        font-size: 0.85rem;
    }

    /* Login Page Mobile */
    .login-card {
        width: 85%;
        padding: 20px;
    }

    .login-card h2 {
        font-size: 1.3rem;
    }

    .login-card input {
        width: 95%;
        padding: 12px;
        font-size: 1rem;
    }

    .login-card button {
        width: 98%;
        padding: 12px;
        font-size: 1rem;
    }

    .login-card p {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    body {
        margin: 10px;
    }

    .box {
        padding: 12px;
        border-radius: 6px;
    }

    .box h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .box p {
        font-size: 0.9rem;
    }

    button {
        padding: 10px 8px;
        font-size: 0.9rem;
    }

    #startBtn, #pauseBtn {
        width: 95%;
        margin-bottom: 8px;
    }

    .header {
        padding-bottom: 8px;
        margin-bottom: 15px;
    }

    .badge {
        font-size: 0.75rem;
        padding: 2px 6px;
    }

    /* Table Responsive */
    table {
        font-size: 0.8rem;
        margin-top: 10px;
    }

    th, td {
        padding: 6px 3px;
        font-size: 0.75rem;
    }

    th {
        font-size: 0.8rem;
    }

    .monospace {
        font-size: 0.65rem;
    }

    .progress-fill {
        height: 30px;
        line-height: 30px;
        font-size: 0.8rem;
    }

    .info-row {
        font-size: 0.8rem;
        gap: 8px;
    }

    /* Login Page Mobile Small */
    .login-card {
        width: 90%;
        padding: 15px;
    }

    .login-card h2 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .login-card input {
        width: 96%;
        padding: 10px;
        font-size: 0.95rem;
    }

    .login-card button {
        width: 98%;
        padding: 10px;
        font-size: 0.95rem;
    }

    .login-card p {
        font-size: 0.7rem;
        line-height: 1.3;
    }
}

/* Landscape Mode */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        margin: 10px;
    }

    .box {
        padding: 15px;
        margin-bottom: 12px;
    }

    button {
        padding: 8px 12px;
        font-size: 0.9rem;
        width: auto;
    }

    #startBtn, #pauseBtn {
        width: 48%;
        display: inline-block;
        margin-right: 2%;
    }

    .progress-fill {
        height: 20px;
        line-height: 20px;
    }

    .info-row {
        flex-direction: row;
        justify-content: space-between;
    }
}


/* ========== إضافات النسخة المحسّنة (بديل الأنماط المضمّنة) ========== */
[hidden] { display: none !important; }

.page-offset { margin-top: 150px; }
.inline-form { display: inline; margin: 0; padding: 0; }
.upload-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#fileInput { margin-bottom: 0; }
#startBtn { margin-right: 0; }
#clearBtn { background: #666; color: #fff; }
#clearBtn:hover:not(:disabled) { background: #444; }
.no-files { text-align: center; color: #000; }

.badge-role { background: #edca97; color: #7b694e; }
.bg-danger { background: #dc3545; }

.header .link-btn {
    background: none;
    box-shadow: none;
    padding: 0;
    color: #450c0c;
    font-weight: 700;
}
.header .link-btn:hover:not(:disabled) { color: #dc3545; transform: none; box-shadow: none; }

.btn-download {
    background: #4d352c;
    color: #fff;
    padding: 4px 12px;
    text-decoration: none;
    border-radius: 19px;
    display: inline-block;
    margin-inline-start: 5px;
    font-size: 12px;
}
.btn-download:hover { background: #6b4a3d; }

button.btn-del {
    background: none;
    box-shadow: none;
    padding: 0 6px;
    font-size: 14px;
    font-weight: 400;
}
button.btn-del:hover:not(:disabled) { transform: none; box-shadow: none; }

.empty-row, .readonly-note, .page-info { color: #2f1c00; }
.empty-row { text-align: center; }
.readonly-note { font-size: 0.8rem; }
.page-info { text-align: center; margin-top: 10px; }

.pagination { display: flex; justify-content: center; margin-top: 20px; gap: 8px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 12px; border-radius: 4px; }
.pagination a { background: #450c0c; color: #fff; text-decoration: none; }
.pagination a:hover { background: #7b4f0e; }
.pagination .current { background: #37240a; color: #fff; font-weight: 700; }
.pagination .dots { color: #2f1c00; }

.msg { padding: 10px 14px; border-radius: 6px; margin: 10px 0; font-size: 0.9rem; }
.msg-ok { background: #d9f0d9; color: #14532d; }
.msg-err { background: #f8d7da; color: #7a1c24; }

:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
