:root {
    --primary-color: #ff8000;
    --secondary-color: #ff8000;
    --success-color: #ff8000;
    --warning-color: #ff8000;
    --bg-dark: #222;
    --bg-card: #2a2a2a;
    --bg-hover: #333;
    --text-white: #ffffff;
    --text-light: #cccccc;
    --text-muted: #888888;
    --border-color: #444;
    --shadow: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-hover: 0 4px 16px rgba(255,128,0,0.3);
}

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

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

header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-bottom: 2px solid var(--primary-color);
    color: white;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.header-content {
    text-align: center;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    opacity: 0.9;
    font-size: 1.1rem;
}

.controls {
    max-width: 1200px;
    margin: 0 auto;
}

.search-box {
    margin-bottom: 1rem;
}

#search {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text-white);
    box-shadow: var(--shadow);
    transition: border-color 0.3s;
}

#search:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

select, .export-btn, .mode-btn, .zoom-btn {
    padding: 0.6rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text-white);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

select:hover, .export-btn:hover, .mode-btn:hover, .zoom-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.export-btn {
    background: var(--primary-color);
    color: var(--bg-dark);
    font-weight: 600;
    border-color: var(--primary-color);
}

.export-btn:hover, .mode-btn:hover {
    background: #ff9933 !important;
    border-color: #ff9933 !important;
}

.zoom-btn {
    min-width: 44px;
    padding: 0.6rem 0.8rem;
}

.zoom-btn:hover:not(:disabled) {
    color: var(--primary-color);
}

.zoom-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.stats {
    text-align: center;
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 1.1rem;
    opacity: 0.95;
}

.loading {
    text-align: center;
    padding: 4rem;
    font-size: 1.5rem;
    color: var(--text-muted);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* Overstyres av JavaScript */
    gap: 2rem;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.artwork-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.artwork-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.artwork-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.artwork-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #1a1a1a;
}

.artwork-placeholder {
    color: var(--primary-color);
    font-size: 4rem;
    opacity: 0.5;
}

.priority-badge-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: var(--bg-dark);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(255,128,0,0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.priority-badge-overlay:hover {
    background: #ff3333;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255,51,51,0.6);
}

.priority-badge-overlay:active {
    transform: scale(0.95);
}

.rating-badge-overlay {
    position: absolute;
    top: 4rem;
    right: 1rem;
    background: var(--bg-card);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: all 0.2s;
}

.rating-badge-overlay:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
    box-shadow: 0 4px 12px rgba(255,128,0,0.4);
}

.bilde-nummer {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.artwork-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.artwork-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-white);
}

.artwork-artist {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.artwork-details {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    flex: 1;
}

.artwork-details > div {
    padding: 0.3rem 0;
}

.detail-label {
    font-weight: 600;
    color: var(--text-white);
}

.priority-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.priority-input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-white);
    border-radius: 6px;
    width: 100px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.priority-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.set-priority-btn {
    background: var(--primary-color);
    color: var(--bg-dark);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    flex: 1;
}

.set-priority-btn:hover {
    background: #ff9933;
    transform: translateY(-2px);
}

.set-priority-btn:active {
    transform: scale(0.98);
}

.mode-btn {
    background: var(--primary-color);
    color: var(--bg-dark);
    font-weight: 600;
    border-color: var(--primary-color);
}

/* Rating View Styles */
.rating-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 1000;
    overflow-y: auto;
    padding: 1rem 2rem 2rem 2rem;
}

.rating-container {
    max-width: 900px;
    margin: 0 auto;
    padding-top: 1rem;
}

.rating-progress {
    margin-bottom: 2rem;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #ffaa44);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-light);
}

.rating-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.rating-image-container {
    width: 100%;
    aspect-ratio: 1/1;
    max-height: 500px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rating-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.rating-info {
    padding: 2rem;
}

.rating-bilde-nr {
    display: inline-block;
    background: var(--primary-color);
    color: var(--bg-dark);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 1rem;
}

.rating-title {
    font-size: 2rem;
    color: var(--text-white);
    margin-bottom: 0.5rem;
}

.rating-artist {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-style: italic;
    margin-bottom: 1rem;
}

.rating-details {
    color: var(--text-light);
    font-size: 1rem;
}

.rating-controls {
    text-align: center;
    margin-bottom: 2rem;
}

.rating-question {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 1.5rem;
}

.rating-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.rating-btn {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-white);
}

.rating-btn:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--bg-dark);
}

.rating-btn.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--bg-dark);
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(255,128,0,0.5);
}

.rating-labels {
    display: flex;
    justify-content: space-between;
    color: var(--text-light);
    font-size: 0.9rem;
    max-width: 680px;
    margin: 0 auto;
}

.rating-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.skip-btn, .back-btn, .finish-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.skip-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-light);
}

.skip-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-light);
    color: var(--text-white);
}

.back-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-light);
}

.back-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.finish-btn {
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    color: var(--bg-dark);
    padding: 1rem 3rem;
}

.finish-btn:hover {
    background: #ff9933;
    border-color: #ff9933;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255,128,0,0.5);
}

.exit-rating-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-white);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    z-index: 1001;
}

.exit-rating-btn:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
    border-color: var(--primary-color);
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .gallery {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .filter-group {
        flex-direction: column;
    }
    
    .stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .rating-view {
        padding: 0.5rem;
    }
    
    .rating-container {
        padding-top: 0.5rem;
    }
    
    .rating-progress {
        margin-bottom: 1rem;
    }
    
    .rating-image-container {
        max-height: 300px;
    }
    
    .rating-title {
        font-size: 1.3rem;
    }
    
    .rating-artist {
        font-size: 1.1rem;
    }
    
    .rating-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .exit-rating-btn {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Drag and Drop Styling */
.drag-help-text {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.drag-help-text strong {
    color: var(--primary-color);
}

.artwork-card.draggable {
    cursor: move;
    transition: all 0.2s ease;
}

.artwork-card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

.artwork-card.drag-over {
    border-color: var(--primary-color);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255,128,0,0.4);
}

/* Animasjoner */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.artwork-card {
    animation: fadeIn 0.5s ease-out;
}

/* Help Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--bg-card);
    margin: 5% auto;
    padding: 2rem;
    border: 2px solid var(--primary-color);
    border-radius: 16px;
    max-width: 800px;
    position: relative;
    box-shadow: 0 4px 30px rgba(255,128,0,0.3);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--primary-color);
    transform: scale(1.2);
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.help-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.help-section h3 {
    color: var(--text-white);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.help-section ol, .help-section ul {
    color: var(--text-light);
    margin-left: 1.5rem;
    line-height: 1.8;
}

.help-section li {
    margin-bottom: 0.5rem;
}

.help-section p {
    color: var(--text-light);
    line-height: 1.8;
}

.help-section kbd {
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.help-section strong {
    color: var(--text-white);
}

@media (max-width: 768px) {
    .modal-content {
        margin: 2% 1rem;
        padding: 1.5rem;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .help-section h3 {
        font-size: 1.1rem;
    }
}

