/* ============================================
   INDUSTRIAL DICOM CONVERTER STYLES
   Accessible Light Theme — Large Fonts
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    /* Industrial light color palette — high contrast */
    --bg-base: #d8d4c8;              /* aged paper / workshop wall */
    --bg-panel: #c8c4b8;
    --bg-panel-hover: #b8b4a8;
    --bg-inset: #e8e4d8;            /* lighter inset */
    --border-metal: #6a6860;         /* dark metal */
    --border-highlight: #4a4840;
    --text-primary: #1a1a1a;         /* near black */
    --text-secondary: #3a3830;
    --text-dim: #5a5850;
    --accent-warn: #8b4513;          /* dark copper/rust */
    --accent-active: #2d5a2d;        /* dark green */
    --accent-danger: #8b1a1a;        /* dark red */
    --accent-info: #1a3a5a;          /* dark steel blue */
    --shadow-inset: inset 0 2px 4px rgba(0,0,0,0.15);
    --shadow-raised: 2px 3px 5px rgba(0,0,0,0.2);
}

html {
    font-size: 18px;                  /* BASE: large default */
}

body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;                 /* increased for readability */
    min-height: 100vh;
}

/* --- Layout --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

/* --- Typography --- */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin: 0 0 0.75rem 0;
}

h1 {
    font-size: 2.2rem;
    color: var(--text-primary);
    border-bottom: 3px solid var(--border-metal);
    padding-bottom: 0.6rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.15rem;
    margin: 0.6rem 0;
    font-weight: 500;
}

.privacy-note {
    color: var(--text-dim);
    font-size: 0.95rem;
    border-left: 5px solid var(--accent-warn);
    padding-left: 1rem;
    margin: 1.25rem 0 0 0;
    font-style: italic;
    line-height: 1.5;
}

/* --- Header --- */
header {
    margin-bottom: 2rem;
}

/* --- Upload / Drop Zone --- */
.upload-section {
    margin-bottom: 1.5rem;
}

.drop-zone {
    border: 3px dashed var(--border-metal);
    border-radius: 3px;
    background-color: var(--bg-panel);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
    position: relative;
}

.drop-zone::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 2px solid var(--bg-inset);
    pointer-events: none;
}

.drop-zone:hover {
    border-color: var(--accent-warn);
    background-color: var(--bg-panel-hover);
}

.drop-zone.dragover {
    border-color: var(--accent-active);
    background-color: var(--bg-inset);
}

.drop-zone-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--text-dim);
    margin-bottom: 1rem;
}

.drop-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.4rem 0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.drop-subtext {
    color: var(--text-secondary);
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.file-types {
    color: var(--text-dim);
    font-size: 1rem;
    margin: 1rem 0 0 0;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-weight: 500;
}

/* --- Progress Bar --- */
.progress-section {
    margin-bottom: 1.5rem;
}

.progress-section.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 28px;
    background-color: var(--bg-inset);
    border: 2px solid var(--border-metal);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-inset);
}

.progress-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 12px,
        rgba(0,0,0,0.08) 12px,
        rgba(0,0,0,0.08) 24px
    );
    pointer-events: none;
}

.progress-fill {
    height: 100%;
    background-color: var(--accent-warn);
    width: 0%;
    transition: width 0.2s ease;
    position: relative;
}

.progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background-color: rgba(255,255,255,0.4);
}

/* --- Status --- */
.status-section {
    margin-bottom: 1.5rem;
}

.status {
    margin: 0;
    padding: 1rem 1.25rem;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 1.05rem;
    border-left: 6px solid var(--border-metal);
    background-color: var(--bg-panel);
    line-height: 1.5;
}

.status.info {
    border-left-color: var(--accent-info);
    color: var(--text-secondary);
}

.status.success {
    border-left-color: var(--accent-active);
    color: var(--accent-active);
}

.status.error {
    border-left-color: var(--accent-danger);
    color: var(--accent-danger);
}

.status.warn {
    border-left-color: var(--accent-warn);
    color: var(--accent-warn);
}

/* --- Results --- */
.results-section {
    margin-bottom: 1.5rem;
}

.results-section.hidden {
    display: none;
}

/* Result items if dynamically added */
.result-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem;
    background-color: var(--bg-panel);
    border: 2px solid var(--border-metal);
    margin-bottom: 0.75rem;
}

.result-item img {
    max-width: 160px;
    max-height: 160px;
    border: 2px solid var(--bg-inset);
    background-color: var(--bg-inset);
}

.result-item .filename {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 1rem;
    color: var(--text-primary);
}

.result-item .meta {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* --- File List --- */
.file-list-section {
    margin-bottom: 1.5rem;
}

.file-list-section h2 {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: var(--bg-panel);
    border: 2px solid var(--border-metal);
    max-height: 280px;
    overflow-y: auto;
}

.file-list li {
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--bg-inset);
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 1rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-list li:last-child {
    border-bottom: none;
}

.file-list li .remove-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0 0.35rem;
}

.file-list li .remove-btn:hover {
    color: var(--accent-danger);
}

/* Scrollbar styling */
.file-list::-webkit-scrollbar {
    width: 16px;
}

.file-list::-webkit-scrollbar-track {
    background: var(--bg-inset);
}

.file-list::-webkit-scrollbar-thumb {
    background: var(--border-metal);
    border: 3px solid var(--bg-inset);
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-highlight);
}

/* --- Buttons --- */
.actions-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-metal);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.6rem;
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid var(--border-metal);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.1s;
    font-family: inherit;
    box-shadow: var(--shadow-raised);
    min-height: 52px;                 /* touch-friendly */
}

.btn svg {
    width: 22px;
    height: 22px;
}

.btn-primary {
    background-color: var(--bg-panel);
    color: var(--text-primary);
    border-color: var(--accent-active);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--accent-active);
    color: #ffffff;
    border-color: var(--accent-active);
}

.btn-primary:active:not(:disabled) {
    box-shadow: var(--shadow-inset);
    transform: translateY(2px);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border-metal);
}

.btn-secondary {
    background-color: var(--bg-panel);
    color: var(--text-secondary);
    border-color: var(--border-metal);
}

.btn-secondary:hover {
    background-color: var(--bg-panel-hover);
    color: var(--text-primary);
    border-color: var(--border-highlight);
}

.btn-secondary:active {
    box-shadow: var(--shadow-inset);
    transform: translateY(2px);
}

/* --- Footer --- */
footer {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 2px solid var(--border-metal);
    font-size: 1rem;
    color: var(--text-dim);
}

footer a {
    color: var(--accent-info);
    text-decoration: underline;
    font-weight: 600;
}

footer a:hover {
    color: var(--text-primary);
}

/* --- Utility --- */
.hidden {
    display: none !important;
}

/* --- Selection --- */
::selection {
    background-color: var(--accent-warn);
    color: #ffffff;
}

/* ============================================
   ACCESSIBILITY EXTRAS
   ============================================ */

/* Focus indicators for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--accent-warn);
    outline-offset: 2px;
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    :root {
        --border-metal: #000000;
        --text-primary: #000000;
        --text-secondary: #222222;
    }

    .drop-zone {
        border-width: 4px;
    }

    .btn {
        border-width: 3px;
    }
}

.preview-thumb {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-thumb:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

