/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    color: #2c5282;
    font-size: 2rem;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1rem;
}

/* Sections */
section {
    background: white;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

section h2 {
    color: #2c5282;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* Upload Section */
.upload-area {
    text-align: center;
    padding: 30px;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    background: #f8fafc;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #4299e1;
    background: #ebf8ff;
}

#photo-input {
    display: none;
}

.upload-label {
    display: inline-block;
    padding: 12px 24px;
    background: #4299e1;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
}

.upload-label:hover {
    background: #3182ce;
}

.upload-info {
    margin-top: 10px;
    color: #666;
    font-size: 0.9rem;
}

/* Photos List */
.photos-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.photo-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.photo-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.photo-info {
    padding: 10px;
}

.photo-name {
    font-size: 0.9rem;
    color: #2d3748;
    margin-bottom: 5px;
    word-break: break-all;
}

.photo-status {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.status-pending {
    background: #fed7d7;
    color: #c53030;
}

.status-placed {
    background: #c6f6d5;
    color: #2f855a;
}

.status-processing {
    background: #fef5e7;
    color: #d69e2e;
}

.exif-status {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 3px;
    font-style: italic;
}

.photo-coords {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

.photo-actions {
    margin-top: 8px;
}

.btn-small {
    font-size: 0.8rem;
    padding: 4px 8px;
    margin-right: 5px;
}

/* Map */
.map-info {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.map-container {
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-right: 10px;
}

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

.btn-primary {
    background: #4299e1;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #3182ce;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-small {
    font-size: 0.8rem;
    padding: 4px 8px;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

/* Controls */
.controls-section {
    text-align: center;
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.photo-preview {
    text-align: center;
    margin-bottom: 20px;
}

.photo-preview img {
    max-width: 200px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2d3748;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

.error-msg {
    display: block;
    color: #e53e3e;
    font-size: 0.8rem;
    margin-top: 4px;
}

.modal-actions {
    text-align: center;
    margin-top: 20px;
}

/* Messages */
.messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.message {
    background: white;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

.message-success {
    border-left-color: #48bb78;
}

.message-error {
    border-left-color: #f56565;
}

.message-info {
    border-left-color: #4299e1;
}

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

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .photos-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
    }
    
    .map-container {
        height: 300px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
}