/* ScrollViewr - Dark Mode CSS */
:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent: #007acc;
    --accent-hover: #005a9e;
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --border: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* Full width container for viewer pages */
.viewer-container {
    max-width: none;
    margin: 0;
    padding: 1rem;
    width: 100%;
}

h1, h2, h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

/* Form Elements */
input, textarea, button {
    font-family: inherit;
    font-size: 1rem;
}

input[type="text"], input[type="file"], textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
button, .btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button:hover, .btn:hover {
    background-color: var(--accent-hover);
}

button:disabled {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* Drag and Drop Zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    background-color: var(--bg-secondary);
    margin-bottom: 2rem;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background-color: rgba(0, 122, 204, 0.1);
}

.upload-zone.error {
    border-color: var(--error);
    background-color: rgba(220, 53, 69, 0.1);
}

.upload-zone-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.upload-text {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.upload-subtext {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
    display: none;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent);
    width: 0%;
    transition: width 0.3s ease;
}

/* Callout Messages */
.callout {
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
    display: none;
}

.callout.show {
    display: block;
}

.callout.error {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--error);
    color: #ff6b7a;
}

.callout.success {
    background-color: rgba(40, 167, 69, 0.1);
    border: 1px solid var(--success);
    color: #5cb85c;
}

.callout.warning {
    background-color: rgba(255, 193, 7, 0.1);
    border: 1px solid var(--warning);
    color: #ffc107;
}

/* Image Viewer */
.image-container {
    text-align: center;      /* Center small images horizontally */
    margin: 1rem 0;
    padding: 0;
    width: 100%;             /* Full container width */
    display: flex;           /* Use flexbox for better centering */
    justify-content: center; /* Center content horizontally */
    align-items: flex-start; /* Align to top */
    flex-direction: column;  /* Stack elements vertically */
}

.image-placeholder {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.main-image {
    max-width: 100%;        /* Scale down if too wide, but never wider than page */
    width: auto;            /* Maintain natural width unless scaling down */
    height: auto;           /* Always maintain aspect ratio */
    border-radius: 4px;
    box-shadow: 0 4px 12px var(--shadow);
    margin: 0 auto 1rem auto;  /* Center horizontally */
    display: block;
}

/* Notes Display */
.notes-section {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 4px;
    margin: 2rem 0;
}

.notes-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.notes-content {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Copy Button */
.copy-button {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    margin-left: 0.5rem;
}

.copy-button:hover {
    background-color: var(--bg-secondary);
}

.copy-button.copied {
    background-color: var(--success);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .upload-zone {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for keyboard navigation */
button:focus, input:focus, textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Hidden file input */
.hidden {
    display: none;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}