/* ProTagger - Main Stylesheet */

:root {
    --primary-color: #4f7700;
    --primary-dark: #3d5f00;
    --primary-light: #6eb800;
    --secondary-color: #717070;
    --success-color: #6eb800;
    --warning-color: #6eb800;
    --danger-color: #d1e0b0;
    --light-bg: #d1e0b0;
    --border-color: #c1c1c1;
    --text-dark: #000000;
    --text-light: #717070;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background-color: var(--light-bg);
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--primary-color);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.navbar-menu {
    list-style: none;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.navbar-menu a {
    text-decoration: none;
    color: var(--text-dark);
    padding: 0.4rem 0.8rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    background-color: var(--primary-color);
    color: white;
}

.navbar-menu a.admin-link {
    background-color: var(--primary-light);
    color: var(--text-dark);
    font-weight: 600;
}

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

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

.page-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-light);
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    color: var(--text-light);
    font-size: 0.875rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Forms */
.form-group {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-field {
    margin-bottom: 1.5rem;
}

.form-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 119, 0, 0.1);
}

.form-field small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-light);
}

.form-field.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-field.checkbox input {
    width: auto;
    margin: 0;
}

.form-field.checkbox label {
    margin-bottom: 0;
}

.form-inline {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.form-inline .form-field {
    margin-bottom: 0;
    flex: 1;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a5859;
}

.btn-success {
    background-color: var(--success-color);
    color: var(--text-dark);
}

.btn-success:hover {
    background-color: #5ba700;
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--text-dark);
}

.btn-danger:hover {
    background-color: #c7d89f;
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--text-dark);
}

.btn-warning:hover {
    background-color: #5ba700;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert p {
    margin: 0.25rem 0;
}

.alert-success {
    background-color: #e8f4d8;
    color: #3d5f00;
    border: 1px solid #d1e0b0;
}

.alert-error {
    background-color: #ffe8e8;
    color: #5f2c00;
    border: 1px solid #ffcaca;
}

.alert-warning {
    background-color: #fff9e8;
    color: #5f5c00;
    border: 1px solid #fff0b8;
}

.alert-info {
    background-color: #e8f1ff;
    color: #1c3d6b;
    border: 1px solid #d1e0ff;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background-color: #e8f4d8;
    color: #3d5f00;
}

.badge-warning {
    background-color: #fff9e8;
    color: #5f5c00;
}

.badge-error {
    background-color: #ffe8e8;
    color: #5f2c00;
}

/* Folders Section */
.folders-section {
    margin-top: 2rem;
}

.folders-section h3 {
    margin-bottom: 1.5rem;
}

.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.folder-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.folder-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.folder-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.folder-header h4 {
    margin: 0;
    word-break: break-word;
}

.folder-status {
    margin-left: 1rem;
}

.folder-stats {
    padding: 1rem 1.5rem;
    background-color: var(--light-bg);
}

.folder-stats p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.folder-actions {
    padding: 1rem 1.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.folder-actions button {
    flex: 1;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

/* Upload Section */
.upload-section {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.upload-section h3 {
    margin-bottom: 1rem;
}

#folderMessage {
    margin-top: 1rem;
    min-height: 2rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    float: right;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
}

.close:hover {
    color: var(--text-dark);
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.auth-form {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-form h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.auth-form h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-light);
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
    max-width: 100%;
}

thead {
    background-color: var(--light-bg);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background-color: #f9fafb;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-menu {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .navbar-menu a {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }

    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .folders-grid {
        grid-template-columns: 1fr;
    }

    .form-inline {
        flex-direction: column;
    }

    .form-inline .form-field {
        margin-bottom: 1rem;
    }
}

/* Upload Progress */
.upload-progress {
    margin: 1rem 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: var(--border-color);
    border-radius: 0.375rem;
    overflow: hidden;
}

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

/* Parameter Configuration */
.parameter-section {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.parameter-ranges {
    display: grid;
    gap: 1rem;
}

.range-item {
    padding: 1rem;
    background-color: var(--light-bg);
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.range-item h4 {
    margin-top: 0;
}

.range-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.range-grid .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stats-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
    text-transform: uppercase;
}

.stats-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stats-subtitle {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* File Links and Image Tooltip */
.file-link {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    position: relative;
}

.file-link:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* Image Tooltip */
.image-tooltip {
    position: fixed;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    pointer-events: none;
    z-index: 1000;
    display: none;
    max-width: 50vw;
    animation: fadeIn 0.2s ease-in-out;
}

.image-tooltip.visible {
    display: block;
}

.image-tooltip img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    border-radius: 0.375rem;
}

.image-tooltip .tooltip-filename {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
/* Enhanced Upload Window */
.modal-large {
    max-width: 700px;
}

.upload-phase {
    animation: fadeIn 0.3s ease;
}

.upload-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.upload-stat {
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    text-align: center;
}

.upload-stat .stat-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.upload-stat .stat-value {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 0;
}

.upload-stat .stat-value.success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.upload-stat .stat-value.error {
    background: linear-gradient(135deg, #f44336 0%, #da190b 100%);
}

.upload-progress-section {
    margin: 20px 0;
}

.progress-bar-large {
    width: 100%;
    height: 30px;
    background-color: var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar-large .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #45a049 100%);
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.files-section {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
}

.files-section h4 {
    margin-bottom: 12px;
    color: #333;
    font-size: 14px;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-entry {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    animation: slideIn 0.3s ease;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
}

.file-icon {
    font-size: 16px;
}

.file-name {
    flex: 1;
    color: #333;
    word-break: break-word;
    font-weight: 500;
}

.file-size {
    color: #999;
    font-size: 12px;
    min-width: 50px;
    text-align: right;
}

.file-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-progress-bar {
    flex: 1;
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.file-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #45a049 100%);
    width: 0%;
    transition: width 0.2s ease;
}

.file-status {
    font-size: 11px;
    font-weight: bold;
    min-width: 60px;
    text-align: right;
    color: #666;
    padding: 2px 6px;
    border-radius: 3px;
    background: #f0f0f0;
}

.file-status.success {
    color: #4CAF50;
    background: #e8f5e9;
}

.file-status.error {
    color: #f44336;
    background: #ffebee;
}

.file-status.pending {
    color: #ff9800;
    background: #fff3e0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-summary {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 6px;
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.error-item {
    color: #c62828;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #ffcdd2;
}

.error-item:last-child {
    border-bottom: none;
}

.completion-banner {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    background: #e8f5e9;
    border-left: 4px solid #4CAF50;
}

.completion-banner h4 {
    color: #2e7d32;
    margin: 0;
    font-size: 16px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.form-hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}