:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --background-color: #f5f6fa;
}

/* Splashscreen styles */
.splashscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.splashscreen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.splashscreen-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out;
}

.splashscreen-logo {
    max-width: 200px;
    height: auto;
    opacity: 0;
    animation: fadeInStagger 0.8s ease-out forwards;
}

.splashscreen-logo:nth-child(1) {
    animation-delay: 0.2s;
}

.splashscreen-logo:nth-child(2) {
    animation-delay: 0.4s;
}

.splashscreen-loader {
    width: 200px;
    height: 3px;
    background-color: #eee;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    opacity: 0;
    animation: fadeIn 0.3s ease-out 0.8s forwards;
}

.splashscreen-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background-color: var(--secondary-color);
    animation: loading 2s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInStagger {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes loading {
    0% {
        width: 0;
    }
    20% {
        width: 20%;
    }
    50% {
        width: 60%;
    }
    80% {
        width: 85%;
    }
    100% {
        width: 100%;
    }
}

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

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

#app {
    min-height: 100vh;
}

.initial-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
}

.initial-screen h1 {
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.language-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 600px;
    width: 100%;
}

.language-buttons button {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 8px;
    background-color: var(--secondary-color);
    color: white;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.language-buttons button:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

.hidden {
    display: none !important;
}

/* Main interface styles */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.main-nav > button {
    flex-shrink: 0;
}

.main-nav button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    background-color: var(--secondary-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.main-nav button:hover {
    background-color: var(--primary-color);
}

/* Map styles */
#map {
    height: 500px;
    width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#map.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    margin: 0;
    border-radius: 0;
}

.location-selection-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    z-index: 1001;
    text-align: center;
    pointer-events: none;
}

.location-selection-overlay button {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    pointer-events: auto;
}

/* Form styles */
.form-container {
    position: relative;
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 500;
}

.form-group .help-text {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--secondary-color);
    outline: none;
}

.form-group input[type="file"] {
    padding: 0.5rem;
    border: 2px dashed #ddd;
    background: #f8f9fa;
    cursor: pointer;
}

.location-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.location-buttons button {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    background-color: #f8f9fa;
    color: var(--primary-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.location-buttons button:hover {
    background-color: #e9ecef;
}

/* Gallery styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.gallery-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: height 0.3s ease;
}

.gallery-item.expanded img {
    height: 300px;
}

.gallery-item-info {
    padding: 1rem;
}

.info-fields {
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.gallery-item.expanded .info-fields {
    max-height: 500px;
}

.info-field {
    margin-bottom: 0.8rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
}

.info-field strong {
    display: block;
    color: var(--primary-color);
    font-size: 0.9em;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-field p {
    margin: 0;
    color: #495057;
    line-height: 1.4;
}

.gallery-item .date {
    margin: 1rem 0;
    color: #666;
    font-size: 0.9em;
    text-align: right;
}

.gallery-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.gallery-item-actions button {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    background: var(--secondary-color);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.gallery-item-actions button:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
}

.gallery-item-actions .expand-info {
    background: #6c757d;
}

.gallery-item-actions .expand-info:hover {
    background: #545b62;
}

.selecting-location {
    position: relative;
}

.selecting-location::after {
    content: attr(data-selecting-message);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
}

#back-to-map {
    margin-bottom: 1rem;
}

.help-text {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .language-buttons {
        grid-template-columns: 1fr;
    }
    
    .main-nav {
        flex-direction: column;
    }
    
    .form-container {
        margin: 1rem;
        padding: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }
    
    .location-buttons {
        flex-direction: column;
    }
}

.biography-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-description {
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.6;
}

.photo-preview {
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
    max-width: 300px;
}

.photo-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.biography-form .form-group {
    margin-bottom: 2rem;
}

.biography-form label {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
}

.biography-form .help-text {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.biography-form input[type="text"] {
    font-size: 1.1rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 100%;
    transition: border-color 0.3s;
}

.biography-form input[type="text"]:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.biography-form input[type="file"] {
    padding: 1rem;
    border: 2px dashed #ddd;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
    background: #f8f9fa;
    transition: border-color 0.3s, background-color 0.3s;
}

.biography-form input[type="file"]:hover {
    border-color: var(--secondary-color);
    background-color: #f1f4f7;
}

.biography-form button[type="submit"] {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.biography-form button[type="submit"]:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .biography-form {
        padding: 1rem;
    }
    
    .biography-form input[type="text"],
    .biography-form input[type="file"] {
        font-size: 1rem;
        padding: 0.8rem;
    }
    
    .photo-preview {
        max-width: 100%;
    }
}

.back-button {
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

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

.location-status {
    margin-bottom: 1rem;
    padding: 0.8rem;
    border-radius: 4px;
    background: #f8f9fa;
    color: #495057;
    font-size: 0.9rem;
}

#trace-form.selecting-location {
    position: relative;
}

#trace-form.selecting-location::after {
    content: "Click on the map to set location";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    z-index: 1000;
}

#refine-location {
    width: 100%;
    padding: 0.8rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0.5rem;
}

#refine-location:hover {
    background: var(--primary-color);
}

.modal-map-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
}

.modal-map {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 80%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    padding: 1rem;
}

.modal-map-content {
    width: 100%;
    height: calc(100% - 60px);
}

.modal-map-actions {
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.modal-map-actions button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.modal-map-actions .confirm-location {
    background: var(--secondary-color);
    color: white;
}

.modal-map-actions .cancel-location {
    background: #6c757d;
    color: white;
}

.trace-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.trace-item {
    position: relative;
    aspect-ratio: 1;
}

.trace-item input[type="checkbox"] {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
    width: 1.2rem;
    height: 1.2rem;
}

.trace-item label {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.trace-item label:hover {
    border-color: var(--secondary-color);
}

.trace-item input[type="checkbox"]:checked + label {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px var(--secondary-color);
}

.trace-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.biography-form .form-group {
    margin-bottom: 2rem;
}

.biography-form .help-text {
    display: block;
    margin: 0.5rem 0;
    color: #666;
    font-style: italic;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(90vh - 130px);
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-footer button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

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

.cancel-traces {
    background: #6c757d;
    color: white;
}

.selected-traces-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.selected-trace-preview {
    position: relative;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
}

.selected-trace-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-trace {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.remove-trace:hover {
    background: rgba(0, 0, 0, 0.8);
}

.secondary-button {
    background: var(--secondary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    width: 100%;
    margin-top: 0.5rem;
    transition: background-color 0.2s;
}

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

.biography-item .trace-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.biography-item .trace-preview {
    position: relative;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
}

.biography-item .trace-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.biography-item .selected-traces {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.biography-item .selected-traces strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

#add-biography-btn {
    background-color: var(--accent-color);
}

#add-biography-btn:hover {
    background-color: var(--primary-color);
}

.biography-form .form-group:not(:last-child) {
    border-bottom: 1px solid #eee;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.biography-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    display: none;
    overflow-y: auto;
}

.biography-details-modal.active {
    display: block;
}

.biography-details-content {
    background: white;
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 8px;
    position: relative;
}

.biography-details-content img.main-photo {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.biography-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.biography-details-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.close-biography-details {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
    padding: 0.5rem;
}

.biography-details-info {
    margin-bottom: 2rem;
}

.biography-details-info .info-field {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
}

.biography-details-traces {
    margin-top: 2rem;
}

.biography-details-traces h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.biography-details-traces .trace-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.biography-details-traces .trace-preview {
    flex: 0 0 150px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.biography-details-traces .trace-preview:hover {
    transform: scale(1.05);
}

.biography-details-traces .trace-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.biography-details-date {
    text-align: right;
    color: #666;
    font-size: 0.9rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .biography-details-content {
        margin: 1rem;
        padding: 1rem;
    }
    
    .biography-details-content img.main-photo {
        height: 200px;
    }
    
    .biography-details-traces .trace-preview {
        flex: 0 0 120px;
        height: 120px;
    }
}

/* Trace selection modal styles */
.selected-traces-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.selected-trace-preview {
    flex: 0 0 120px;
    height: 120px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.selected-trace-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Trace selector in modal */
.trace-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
}

.trace-item {
    flex: 0 0 150px;
    height: 150px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.trace-item:hover {
    transform: scale(1.05);
}

.trace-item input[type="checkbox"] {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

.trace-item label {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.trace-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trace-item input[type="checkbox"]:checked + label {
    outline: 3px solid var(--secondary-color);
    outline-offset: -3px;
}

/* Modal header styles */
.modal-header h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .trace-item {
        flex: 0 0 120px;
        height: 120px;
    }
    
    .selected-trace-preview {
        flex: 0 0 100px;
        height: 100px;
    }
    
    .biography-details-traces .trace-preview {
        flex: 0 0 120px;
        height: 120px;
    }
}

/* Map popup styles */
.leaflet-popup-content {
    margin: 0;
    padding: 0;
}

.map-popup {
    min-width: 200px;
    max-width: 300px;
}

.map-popup-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: block;
}

.map-popup-content {
    padding: 12px;
}

.map-popup-info {
    margin-top: 8px;
}

.map-popup-info-field {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.map-popup-info-field strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.map-popup-info-field p {
    margin: 0;
    color: #666;
}

.map-popup-date {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #999;
    text-align: right;
}

/* Trace details modal styles */
.trace-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    display: none;
    overflow-y: auto;
}

.trace-details-modal.active {
    display: block;
}

.trace-details-content {
    background: white;
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 8px;
    position: relative;
}

.trace-details-content img.main-photo {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.trace-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.trace-details-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.close-trace-details {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
    padding: 0.5rem;
}

.trace-details-info {
    margin-bottom: 2rem;
}

.trace-details-info .info-field {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
}

.trace-details-location {
    margin: 2rem 0;
}

.trace-details-location button {
    width: 100%;
    padding: 1rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.trace-details-location button:hover {
    background: var(--primary-color);
}

.trace-details-date {
    text-align: right;
    color: #666;
    font-size: 0.9rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .trace-details-content {
        margin: 1rem;
        padding: 1rem;
    }
    
    .trace-details-content img.main-photo {
        height: 200px;
    }
}

/* Settings buttons styles */
.settings-buttons {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.settings-buttons button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.85rem;
    white-space: normal;
    text-align: center;
    min-width: 120px;
    line-height: 1.2;
}

.settings-buttons button:hover {
    background-color: var(--accent-color);
}

@media (max-width: 768px) {
    .settings-buttons {
        width: 100%;
        margin-top: 0.5rem;
    }

    .settings-buttons button {
        flex: 1;
        min-width: auto;
        padding: 0.8rem 0.5rem;
    }

    .main-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem;
    }
}

/* Language selector in main interface */
#language-selector.initial-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s ease-out;
}

#language-selector.initial-screen h1 {
    margin-bottom: 2rem;
    color: var(--primary-color);
    text-align: center;
    font-size: 1.8rem;
}

#language-selector .language-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 600px;
    width: 100%;
}

#language-selector .language-buttons button {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 8px;
    background-color: var(--secondary-color);
    color: white;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

#language-selector .language-buttons button:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .settings-buttons {
        flex-direction: row;
        width: 100%;
        margin-top: 1rem;
    }

    .settings-buttons button {
        width: 100%;
    }

    #language-selector .language-buttons {
        grid-template-columns: 1fr;
    }

    #language-selector.initial-screen h1 {
        font-size: 1.4rem;
    }
}

/* Image preview modal */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 4000;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.image-preview-modal.active {
    display: flex;
}

.image-preview-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
}

.image-preview-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.close-image-preview {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.gallery-item img,
.biography-item img,
.trace-preview img,
.biography-details-content img.main-photo,
.trace-details-content img.main-photo {
    cursor: pointer;
    transition: opacity 0.2s;
}

.gallery-item img:hover,
.biography-item img:hover,
.trace-preview img:hover,
.biography-details-content img.main-photo:hover,
.trace-details-content img.main-photo:hover {
    opacity: 0.9;
} 