*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    background: #f5f5f5;
    color: #222;
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    margin: 0;
}

.container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 1.75rem;
    max-width: 560px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.icon {
    font-size: 2.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.tagline {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.description {
    margin: 0;
    color: #444;
    font-size: 0.9rem;
    border-left: 3px solid #e0e0e0;
    padding-left: 0.75rem;
}

.drop-zone {
    border: 2px dashed #bbb;
    padding: 2rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, border-color 0.15s;
    background: #fafafa;
}

.drop-zone p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.drop-zone:hover,
.drop-zone.dragover {
    background: #f0f7ff;
    border-color: #0066cc;
}

.drop-zone:hover p,
.drop-zone.dragover p {
    color: #0066cc;
}

.options label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.options input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: #0066cc;
}

.options small {
    display: block;
    color: #666;
    font-size: 0.82rem;
}

button {
    background: #0066cc;
    color: #fff;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.15s;
}

button:hover:not(:disabled) {
    background: #0052a3;
}

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

#status {
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 1.25rem;
}

.status-success {
    color: #10b981;
}

.status-error {
    color: #ef4444;
}

.stats {
    background: #fafafa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.875rem 1rem;
    font-size: 0.82rem;
    max-height: 220px;
    overflow-y: auto;
    color: #444;
}

.log-entry {
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e8ecf0;
}

.log-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.badge {
    background: #e8ecf0;
    color: #555;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 6px;
    font-weight: 500;
}

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 0.6rem;
    font-size: 0.78rem;
    color: #999;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
}

.footer a {
    color: #0066cc;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

@media (max-width: 520px) {
    body {
        padding: 1rem 0.75rem;
    }

    .container {
        padding: 1.5rem 1.25rem;
    }
}

/* --- Collapsible Instructions Styles --- */

.instructions-collapse {
    background: #fafafa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden; /* Keeps the border radius clean when open */
    transition: background 0.2s;
}

.instructions-collapse summary {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    user-select: none;
    list-style: none; /* Hides default arrow */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Hide default marker for webkit */
.instructions-collapse summary::-webkit-details-marker {
    display: none;
}

/* Custom Dropdown Arrow */
.instructions-collapse summary::after {
    content: "▼";
    font-size: 0.75rem;
    color: #888;
    transition: transform 0.2s ease;
}

/* Rotate arrow when open */
.instructions-collapse[open] summary::after {
    transform: rotate(-180deg);
}

.instructions-collapse summary:hover {
    background: #f0f4f8;
}

.instructions-collapse[open] summary {
    border-bottom: 1px solid #e2e8f0;
}

.instructions-content {
    padding: 1rem;
    font-size: 0.9rem;
    color: #444;
    background: #fff;
}

.instructions-content ol {
    margin: 0;
    padding-left: 1.25rem;
}

.instructions-content li {
    margin-bottom: 0.5rem;
}

.instructions-content li:last-child {
    margin-bottom: 0;
}

.instructions-content code {
    background: #f1f5f9;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #dc2626; /* A slight red/markdown code color */
    border: 1px solid #e2e8f0;
}

.gif-wrap {
    display: block;
    margin-top: 1rem;
    text-decoration: none;
}

.instructions-gif {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    display: block;
    background: #fdfdfd;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

/* Hover effect so they know it's clickable */
.gif-wrap:hover .instructions-gif {
    border-color: #0066cc;
    opacity: 0.9;
}

.footer a {
    color: #0066cc;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
}