/* Estilos para el Sistema de Mapa Colaborativo */

/* Marcadores de nodos propuestos */
.proposed-node-marker {
    background: transparent;
    border: none;
}

.proposed-marker {
    position: relative;
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    animation: bounce 2s ease-in-out infinite;
}

.proposed-marker .vote-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f39c12;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Botón de proponer ubicación */
.leaflet-control-custom.active {
    background-color: #00d1b2 !important;
    color: white;
}

.leaflet-control-custom svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Diálogos colaborativos */
.collaborative-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.dialog-content {
    position: relative;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-out;
}

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

.dialog-content h3 {
    margin: 0 0 1.5rem 0;
    color: #00d1b2;
    font-size: 1.5rem;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00d1b2;
}

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

.form-group small {
    color: #8b949e;
    font-size: 0.85rem;
}

.dialog-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #00d1b2;
    color: #0d1117;
}

.btn-primary:hover {
    background: #00b89c;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid #30363d;
    color: #c9d1d9;
}

.btn-secondary:hover {
    background: #161b22;
    border-color: #8b949e;
}

/* Popup de propuestas */
.proposal-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.proposal-popup h4 {
    margin: 0 0 0.75rem 0;
    color: #00d1b2;
    font-size: 1.1rem;
}

.proposal-popup p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #c9d1d9;
}

.proposal-popup strong {
    color: #fff;
}

.vote-section {
    margin: 1rem 0;
}

.vote-btn {
    width: 100%;
    padding: 0.6rem;
    background: #00d1b2;
    color: #0d1117;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-btn:hover:not(:disabled) {
    background: #00b89c;
    transform: scale(1.02);
}

.vote-btn.voted {
    background: #8b949e;
    cursor: not-allowed;
}

.proposal-actions {
    display: flex;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.proposal-actions button {
    flex: 1;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #c9d1d9;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.proposal-actions button:hover {
    background: #161b22;
    border-color: #00d1b2;
    color: #00d1b2;
}

.proposal-popup small {
    display: block;
    margin-top: 0.75rem;
    color: #8b949e;
    font-size: 0.8rem;
}

/* Panel colaborativo */
.collaborative-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
}

.panel-toggle {
    padding: 0.75rem 1.5rem;
    background: #2196F3;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.panel-toggle:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4);
}

.panel-content {
    position: absolute;
    top: 60px;
    left: 0;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 1.25rem;
    min-width: 250px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.3s ease-out;
}

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

.panel-content h4 {
    margin: 0 0 1rem 0;
    color: #00d1b2;
    font-size: 1rem;
}

.panel-content button {
    display: block;
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: transparent;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.panel-content button:hover {
    background: #0d1117;
    border-color: #00d1b2;
    color: #00d1b2;
}

.panel-content button.active {
    background: #00d1b2;
    color: #0d1117;
    border-color: #00d1b2;
    font-weight: 600;
}

.panel-content button#propose-location-btn {
    font-weight: 600;
    border-color: #00d1b2;
}

.panel-content button#propose-location-btn:hover {
    background: #00d1b2;
    color: #0d1117;
}

/* Sección de autenticación */
.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.btn-login,
.btn-register {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-login {
    background: #00d1b2;
    color: #0d1117;
    border-color: #00d1b2;
}

.btn-login:hover {
    background: #00b89c;
    transform: translateY(-1px);
}

.btn-register {
    background: transparent;
    color: #c9d1d9;
    border-color: #30363d;
}

.btn-register:hover {
    background: #0d1117;
    border-color: #00d1b2;
    color: #00d1b2;
}

/* Info de usuario logueado */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

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

.user-name {
    flex: 1;
    color: #00d1b2;
    font-weight: 600;
}

.btn-logout {
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #8b949e;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

/* Divisor del panel */
.panel-divider {
    height: 1px;
    background: #30363d;
    margin: 0.75rem 0;
}

/* Estilos de formularios de auth */
.form-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #30363d;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-footer a {
    color: #00d1b2;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.form-footer a:hover {
    color: #00b89c;
    text-decoration: underline;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: #c9d1d9;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.checkbox-label a {
    color: #00d1b2;
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #c9d1d9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease-out;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid #2ecc71;
}

.notification-error {
    border-left: 4px solid #e74c3c;
}

.notification-info {
    border-left: 4px solid #3498db;
}

/* Responsive */
@media (max-width: 768px) {
    .dialog-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .collaborative-panel {
        top: 10px;
        left: 10px;
    }
    
    .panel-content {
        left: 0;
        right: auto;
        min-width: 200px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}
