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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    overflow: hidden;
    height: 100vh;
}

.hidden {
    display: none !important;
}

/* Password Screen */
.password-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
}

.password-container {
    background: #1a1a1a;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    text-align: center;
    min-width: 320px;
}

.password-container h1 {
    margin-bottom: 2rem;
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#password-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#password-input {
    padding: 0.75rem;
    border: 2px solid #2a2a2a;
    border-radius: 8px;
    background: #0a0a0a;
    color: #e0e0e0;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#password-input:focus {
    border-color: #667eea;
}

#password-form button {
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#password-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.error-message {
    color: #ff6b6b;
    font-size: 0.875rem;
    min-height: 1.25rem;
}

/* Main Application */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Control Panel */
.control-panel {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    flex-wrap: wrap;
}

.panel-section {
    flex: 1;
    min-width: 150px;
}

.search-input,
.filter-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    background: #0a0a0a;
    color: #e0e0e0;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus,
.filter-select:focus {
    border-color: #667eea;
}

.btn-secondary {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    background: #1a1a1a;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #2a2a2a;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #0a0a0a;
}

#map-canvas {
    width: 100%;
    height: 100%;
    cursor: grab;
}

#map-canvas:active {
    cursor: grabbing;
}

/* Add Node Button */
.add-node-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 100;
}

.add-node-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.add-node-btn:active {
    transform: translateY(0);
}

.add-node-btn.placement-mode {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
    }
    50% {
        box-shadow: 0 6px 24px rgba(245, 87, 108, 0.8);
    }
}

.add-node-btn .plus-icon {
    font-size: 1.5rem;
    line-height: 1;
}

/* Map Controls */
.map-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    background: #1a1a1a;
    color: #e0e0e0;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: #2a2a2a;
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Instructions */
.instructions {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 26, 26, 0.9);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    font-size: 0.875rem;
    color: #a0a0a0;
    max-width: 80%;
    text-align: center;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

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

.modal-header h2 {
    font-size: 1.5rem;
    color: #e0e0e0;
}

.close-btn {
    background: none;
    border: none;
    color: #a0a0a0;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #e0e0e0;
}

/* Form */
form {
    padding: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #a0a0a0;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    background: #0a0a0a;
    color: #e0e0e0;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus {
    border-color: #667eea;
}

/* Type Selection */
.type-selection {
    display: flex;
    gap: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid #2a2a2a;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    background: #0a0a0a;
    flex: 1;
}

.radio-label:hover {
    border-color: #667eea;
    background: #1a1a1a;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.radio-label input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.radio-label span {
    color: #e0e0e0;
    font-size: 1rem;
}

/* Star Rating */
.star-rating {
    display: flex;
    gap: 0.25rem;
    font-size: 1.5rem;
    cursor: pointer;
    user-select: none;
}

.star-rating .star {
    color: #3a3a3a;
    transition: color 0.2s;
}

.star-rating .star:hover,
.star-rating .star.active {
    color: #ffd700;
}

.star-rating .star.half {
    color: #ffd700;
    position: relative;
}

/* Star Display (View Only) */
.star-display {
    display: inline-flex;
    gap: 0.125rem;
    font-size: 1.25rem;
}

.star-display .star {
    color: #ffd700;
}

.star-display .star.empty {
    color: #3a3a3a;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
}

.btn-secondary:hover {
    background: #3a3a3a;
}

/* Node Details */
.node-details {
    padding: 1.5rem;
}

.detail-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #2a2a2a;
    gap: 1rem;
}

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

.detail-item label {
    min-width: 100px;
    color: #a0a0a0;
    font-weight: 500;
}

.brand-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.type-badge.type-yart {
    background: #667eea;
    color: white;
}

.type-badge.type-dispo {
    background: #f5576c;
    color: white;
}

.rating-value {
    margin-left: 0.5rem;
    color: #a0a0a0;
    font-size: 0.875rem;
}

.average-rating {
    background: rgba(102, 126, 234, 0.1);
    margin: 1rem 0 0 0;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.average-rating label {
    color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .control-panel {
        flex-direction: column;
    }
    
    .panel-section {
        width: 100%;
    }
    
    .map-controls {
        flex-direction: row;
        top: auto;
        bottom: 5rem;
        right: 1rem;
    }
    
    .add-node-btn {
        bottom: 0.5rem;
        right: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .add-node-btn .btn-text {
        display: none;
    }
    
    .instructions {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
        bottom: 4.5rem;
    }
}
