@import url(/fonts/Vazirmatn-font-face.css);

* {
    font-family: Vazirmatn, system-ui, sans-serif;
    box-sizing: border-box;
}

:root {
    --primary: #d50000;
    --primary-hover: #b71c1c;
    --bg: #f4f6f8;
    --card-bg: #ffffff;
    --text-main: #1a1a1a;
    --text-sub: #666666;
    --border: #eaeaea;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #ff5252;
        --primary-hover: #ff867f;
        --bg: #121212;
        --card-bg: #1e1e1e;
        --text-main: #e0e0e0;
        --text-sub: #a0a0a0;
        --border: #333;
    }

    .file-drop {
        background: #2d2d2d !important;
        border-color: #444 !important;
    }

    .file-drop:hover {
        background: #333 !important;
    }

    .stats {
        background: #333;
    }

    .hist-item {
        border-bottom-color: #333;
    }

    textarea {
        background: #2d2d2d;
        color: #fff;
        border-color: #444;
    }
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
}

@media (max-width: 600px) {
    body {
        padding: 0;
        align-items: flex-start;
    }

    .container {
        max-width: 100%;
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
    }
}

.container {
    background: var(--card-bg);
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
}

.header {
    background: var(--primary);
    padding: 1.5rem 1.5rem 1rem;
    color: white;
    text-align: center;
    position: relative;
}

.header h2 {
    margin: 0;
    font-weight: 800;
    font-size: 1.6rem;
}

.header p {
    margin: 0.5rem 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
}

.stat-item {
    background: var(--card-bg);
    padding: 0.75rem;
    text-align: center;
}

.stat-val {
    display: block;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-sub);
    text-transform: uppercase;
    margin-top: 4px;
    display: block;
}

.upload-area {
    padding: 1.5rem;
}

.file-drop {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: 0.2s;
    position: relative;
    background: #fafafa;
}

.file-drop:hover {
    border-color: var(--primary);
    background: #fff5f2;
}

.file-drop.disabled {
    opacity: 0.6;
    pointer-events: none;
    background: #eee;
}

.file-drop input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block;
}

.btn {
    background: var(--primary);
    color: white;
    width: 100%;
    border: none;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    transition: 0.2s;
}

.btn:hover {
    background: var(--primary-hover);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.progress-cont {
    display: none;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 1rem;
    height: 10px;
}

@media (prefers-color-scheme: dark) {
    .progress-cont {
        background: #333;
    }
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.1s;
}

.proc-text {
    display: none;
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-sub);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

.history {
    padding: 0 1.5rem 1.5rem;
    border-top: 1px solid var(--border);
}

.history h4 {
    margin: 1rem 0 0.5rem;
    font-size: 0.9rem;
    color: var(--text-sub);
}

.hist-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.hist-item:last-child {
    border: none;
}

.hist-item a {
    color: var(--primary);
    text-decoration: none;
    direction: ltr;
}

.footer {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-sub);
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.secure-note {
    margin-top: 0.5rem;
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
}

details>summary {
    list-style: none;
    cursor: pointer;
    outline: none;
    font-weight: 600;
    color: var(--primary);
}

details>summary::-webkit-details-marker {
    display: none;
}

details[open]>summary {
    margin-bottom: 0.5rem;
}