/* Modern CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* ===== MODAL STYLES ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.4s ease;
}

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

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #6b7280;
    font-size: 0.95rem;
}

/* ===== FORM STYLES ===== */
.setup-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"] {
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
    outline: none;
}

.form-group input[type="text"]:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group small {
    color: #6b7280;
    font-size: 0.8rem;
}

/* ===== STYLE PICKER ===== */
.style-picker {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 12px;
}

.emoji-selector, .color-selector {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.emoji-selector label, .color-selector label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.emoji-button {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.emoji-button:hover {
    border-color: #6366f1;
    transform: scale(1.05);
}

.emoji-picker {
    position: absolute;
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 10;
    margin-top: 0.5rem;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    max-width: 250px;
}

.emoji-option {
    background: #f9fafb;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.emoji-option:hover {
    background: #ede9fe;
    border-color: #6366f1;
    transform: scale(1.1);
}

.color-selector input[type="color"] {
    width: 100%;
    height: 60px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.color-selector input[type="color"]:hover {
    border-color: #6366f1;
}

/* ===== BUTTONS ===== */
.primary-button {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    margin-top: 1rem;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.primary-button:active {
    transform: translateY(0);
}

.icon-button {
    background: white;
    border: none;
    border-radius: 12px;
    padding: 0.75rem;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.icon-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===== APP LAYOUT ===== */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

.app-header {
    background: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.header-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.room-name {
    background: #ede9fe;
    color: #6366f1;
    padding: 0.4rem 0.875rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.user-count {
    color: #6b7280;
    font-size: 0.875rem;
}

/* ===== MAP ===== */
#map {
    flex: 1;
    width: 100%;
    z-index: 1;
}

/* ===== USER LIST ===== */
.user-list {
    position: fixed;
    top: 100px;
    right: 1rem;
    background: white;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-width: 250px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 500;
}

.user-list h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

#userListContent {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-item:hover {
    background: #f9fafb;
}

.user-emoji {
    font-size: 1.5rem;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1f2937;
}

.user-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* ===== CONNECTION STATUS ===== */
.connection-status {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0.75rem 1.5rem;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.connection-status.disconnected .status-dot {
    background: #ef4444;
}

.connection-status.connecting .status-dot {
    background: #f59e0b;
}

.status-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1f2937;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .modal-content {
        padding: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .app-title {
        font-size: 1.25rem;
    }

    .header-info {
        font-size: 0.8rem;
    }

    .user-list {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        max-width: 200px;
        max-height: 300px;
    }

    .style-picker {
        flex-direction: column;
    }
}

/* ===== CUSTOM LEAFLET STYLES ===== */
.custom-marker {
    background: transparent;
    border: none;
}

.marker-content {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: markerAppear 0.3s ease;
}

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

.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 0.75rem;
    font-weight: 600;
} 